嘿伙计我有一个脚本,我用来在我的网站上分享帖子,在Facebook上。我正在使用fb.ui sdk,并继续收到此错误:
“发生了错误。请稍后再试。”
设置为在页面加载时弹出。
我注意到app_id在facebook为弹出窗口生成的安全网址中没有ID。这是因为它被隐藏了,还是没有被发送?这是URL的剪辑:
“https://www.facebook.com/dialog/feed?app_id=&caption=Info&”
这是我的代码:
的index.php:
<html>
<head>
<title>Post to Facebook</title>
<script src="http://connect.facebook.net/en_US/all.js"></script>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '1404387053111932',
channelUrl : 'http://website.com/fb/channel.html',
status : true,
xfbml : true
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
</body>
<script>
FB.ui(
{
method: 'feed',
name: 'Facebook Dialogs',
link: 'http://www.website.com',
picture: 'http://www.website.com/images/logo.png',
caption: 'Info',
description: 'InfoInfoInfo'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
</script>
Channel.html:
<script src="http://connect.facebook.net/en_US/all.js"></script>
感谢任何帮助!