2011-11-24 116 views
0

我想用我的网站上的评论框来评论帖子。我粘贴在我的页面生成的代码facebook评论框插件

<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/it_IT/all.js#xfbml=1&appId=IDAPP"; 
     fjs.parentNode.insertBefore(js, fjs); 
    }(document, 'script', 'facebook-jssdk'));</script> 

<div class="fb-comments" data-href="https://facebook.3rdplace.com/zend/ibs_post.php?id=<?=$id_post?>" data-num-posts="2" data-width="470"></div> 

如果我发表评论,它会出现,但它不会保存在Graph上。 问题在哪里?

回答

0

确保您的data-href URL可从外部访问。除此之外,您可以尝试使用comment.create事件进行调试。

像这样:

FB.Event.subscribe('comment.create', function(comment) { 
    console.log(comment); // looking for comment.commentID - https://graph.facebook.com/<comment_id> 
});