2010-12-16 24 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,它會沒事的。

我遇到了網站登錄請求的問題,但如果用戶此時未登錄網站,它會執行

相關問題