我想强调的第一个问题是,由于同源策略,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