我在我的新闻页面上实现了facebook的评论框。而且它是有效的。问题是,如果我在一个页面上发表评论,它将显示在所有包含fb评论框的页面上。
目前,我的代码如下所示:
<b><div class="fb-comments" data-href="http://selandia-ceu.dk/selandia/nyheder.aspx" data-num-posts="3" data-width="500"></div>
<script>
var fb-comments = document.getElementById('fb-comments');
mydiv.innerHTML =
'<div class="fb-comments" data-href="' + document.location.href + '" data-num-posts="3" data-width="500"></fb:comments>';
FB.XFBML.parse(fb-comments);
</script></b>该网站正在使用Microsoft Server。代码中的url应该指向用户正在查看的当前页面。有人知道我应该做什么吗?:)
页面上的评论暂时被禁用。
我从这个线程得到了额外的代码(FB.XFBML.parse):Different Facebook comment box after each ajax call
发布于 2012-05-26 00:02:57
您可能需要清理Open Graph标签,因为每个评论插件所指向的URL将被Open Graph linter抓取并用于确定规范的URL。问题很可能是你的评论插件最终都指向了相同的规范URL:
使用此调试工具检查Open Graph标签,并确保每个页面都有自己的规范URL。您还需要按照调试器的建议更正HTML中的fb:admins标记。
https://stackoverflow.com/questions/10753836
复制相似问题