2011-07-20 143 views
7

我希望用户能够从我的网站发布到他们的墙上。当我点击提交给FB链接时,Facebook弹出窗口中只会显示“发生错误,请稍后再试。” Firebug只是说错误是“图像损坏或截断:”。如果尝试任何FB方法,如FB.login或FB.getLoginStatus,我会得到相同的消息。我知道这并不是什么好事,但是有没有人有什么错误的想法,或者更好的方法来调试呢?用Facebook API发布到墙壁

function load_FB(){ 
    FB.init({ 
    appId : xxxxxxxxxxxxxxxx, 
    status : true, 
    cookie : true, 
    xfbml : true 
    }); 
} 

var publish = {method: 'feed', message: 'my message'}; 
function publish_wall_post() 
{ 
    FB.ui(publish); 
} 

回答

3

https://developers.facebook.com/docs/reference/javascript/FB.ui/

FB.ui(
    { 
    method: 'feed', 
    name: 'Facebook Dialogs', 
    link: 'https://developers.facebook.com/docs/reference/dialogs/', 
    picture: 'http://fbrell.com/f8.jpg', 
    caption: 'Reference Documentation', 
    description: 'Dialogs provide a simple, consistent interface for applications to interface with users.', 
    message: 'Facebook Dialogs are easy!' 
    }, 
    function(response) { 
    if (response && response.post_id) { 
     alert('Post was published.'); 
    } else { 
     alert('Post was not published.'); 
    } 
    } 
); 
+0

看看在FB.ui文档我想这个代码,并得到了完全相同的结果。 – mill

相关问题