无法像按钮一样从Facebook发表评论 [英] Cannot make comments from facebook like button
问题描述
我从 https://developers.facebook.com/docs/reference/plugins获得了类似的按钮代码/like/,并在我的页面上,正确显示了喜欢"按钮...至少看起来像所以:P
I get the like button code from https://developers.facebook.com/docs/reference/plugins/like/, and on my page, the like button is rendered correctly...at least it looks like so :P
但是,当我单击赞"按钮时,评论对话框就会出现并立即消失,并且该按钮成为确认链接;然后我单击赞",一个弹出窗口要求我确认喜欢...然后,当我返回页面时,可以看到评论对话框.但是无论我输入什么,单击 Post 按钮后,对话框都会不关闭.
But when I click on the like button, the comment dialog appear and disappear immediately, and the button becomes a Confirm link; then I click on the like, a popup window ask me to confirm to like it...then, when I back to my page, I can see the comment dialog. But whatever I input, after I clicked on the Post button, the dialog will not close.
在我的Chrome控制台中,当我单击 Post 按钮时,看到对https://www.facebook.com/plugins/like/comment
的请求,返回的结果是:
In my Chrome console, I see when I click on the Post button, a request is make to https://www.facebook.com/plugins/like/comment
, and the return result is:
for (;;);{"__ar":1,"payload":null}
我在其他网站上比较了这种行为,很明显,回报是不同的.但是我不知道为什么.
I compared this behavior on other sites, and it is clear the return is different. But I have no idea why.
推荐答案
通常,可以通过在初始化代码中使用应用程序ID来解决此问题:
Usually that problem can be fixed by using an app id in the init code:
<div id="fb-root"></div>
<script>(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/de_DE/all.js#xfbml=1&appId=xxxxxxxxx";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
那是Facebook的垃圾邮件防护...
That´s Facebooks spam protection...
这篇关于无法像按钮一样从Facebook发表评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!