2010-12-16 59 views
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> 

...出现Facebook的对话却总是说: “发生了错误”

<head> 

...

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> 
</head> 
<body> 
<div id="fb-root"></div> 
<fb:like id="fb-like" href="http://www.example.com" layout="button_count" show_faces="false" width="100"></fb:like> 

...

myscript.js

FB.ui(
    { 
    method: 'stream.publish', 
    message: 'getting educated about Facebook Connect', 
    attachment: { 
     name: 'Connect', 
     caption: 'The Facebook Connect JavaScript SDK', 
     description: (
     'A small JavaScript library that allows you to harness ' + 
     'the power of Facebook, bringing the user\'s identity, ' + 
     'social graph and distribution power to your site.' 
     ), 
     href: 'http://github.com/facebook/connect-js' 
    }, 
    action_links: [ 
     { text: 'Code', href: 'http://github.com/facebook/connect-js' } 
    ], 
    user_message_prompt: 'Share your thoughts about Connect' 
    }, 
    function(response) { 
    if (response && response.post_id) { 
     alert('Post was published.'); 
    } else { 
     alert('Post was not published.'); 
    } 
    } 
); 

我有我的网页上的Facebook按钮,工作正常。

但是,当我拨打FB.ui上述方法从我的JavaScript源,Facebook的对话框弹出,但显示此错误消息:

**An error occurred. Please try again later.** 

自从我开始试图实现它本已多次发生两天。

不是一个非常有用的错误消息。

任何想法可能会导致它或如何缩小问题?

回答

1

它被弃用并不重要,问题是您没有执行操作的权限。确保你的FB.login调用请求publish_stream,它会没事的。

我遇到了网站登录请求的问题,但如果用户此时未登录网站,它会执行

相关问题