我想強調的第一個問題是,由於同源策略,Facebook限制以及Facebook JS SDK中缺少變量,所以不可能告訴正在加載當前應用程序的頁面的URL是什麼。解決方案是使用後端生成URL。但是,應該有JS SDK變量持有這些信息。喜歡Facebook應用內的粉絲頁面,重新加載標籤
http://www.facebook.com/pages/[any-random-string]/[page-id-got-from-signed-request]?sk=app_[app-id]
現在,錯誤本身。我使用這個網址,即可產生像按鈕:
<div class="fb-like" data-href="<?=FACEBOOK_TAB_URL?>" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false" data-font="lucida grande"></div>
而且FB.Event.subscribe
當用戶喜歡內容來檢測。但是,當用戶點擊按鈕一樣,下面的響應來自Facebook的:
{
"__ar":1,
"payload":{
"requires_login":false,
"success":false,
"already_connected":false,
"is_admin":false,
"show_error":true,
"error_info":{
"brief":"An error has occurred.",
"full":"There was an error liking the page. If you are the page owner, please try running your page through the linter on the Facebook devsite (https:\/\/developers.facebook.com\/tools\/lint\/) and fixing any errors.",
"errorUri":"\/connect\/connect_to_node_error.php?title=An+error+has+occurred.&body=There+was+an+error+liking+the+page.+If+you+are+the+page+owner\u00252C+please+try+running+your+page+through+the+linter+on+the+Facebook+devsite+\u002528https\u00253A\u00252F\u00252Fdevelopers.facebook.com\u00252Ftools\u00252Flint\u00252F\u002529+and+fixing+any+errors.&hash=AQBOXfQcBTjYQ9b7"
}
},
"jscc":""
}
很明顯,因爲這是Facebook粉絲頁面的URL,Facebook的調試器是沒有太大的使用我。
你有沒有嘗試過「通過+ Facebook + devsite + + + linter + +運行+你的+頁面」? – graphicdivine 2011-12-16 14:22:37