<!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">
...
<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一样的按钮,效果很好。
但是当我从我的JavaScript源代码调用上面的FB.ui
方法时,会弹出Facebook对话框,但会显示以下错误消息:
**An error occurred. Please try again later.**
自从我开始尝试实施它以来,已经连续两天发生这种情况。
不是一个非常有用的错误消息。
知道可能导致它的原因或如何缩小问题范围吗?
答案 0 :(得分:2)
“此对话框取代旧版www.facebook.com/connect/prompt_feed.php端点和www.facebook.com/connect/uiserver.php?method=stream.publish”
http://developers.facebook.com/docs/reference/dialogs/feed/
如您所见,您正在使用已弃用的内容。
答案 1 :(得分:1)
它被弃用并不重要,问题是您没有权限执行该操作。确保你的FB.login调用请求publish_stream,它会没事的。
我遇到了网站登录请求此问题的问题,但如果用户此时未登录该网站,则会执行此操作
答案 2 :(得分:0)