0

I've added the Facebook social plug-in to my site, which allows users to comment using their facebook profile. However, I have more than 1 item on a page, and want users to make individual comments, because currently, when a user makes a comment on 1 item, it adds that comment to every item. This is probably because each item is called onto the site using a while loop which echo's and prints every single item stored in my database. Does anyone know if there's a way around this or not? If it helps, the code facebook provides users with is as follows:

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

and

<div class='fb-comments' data-href='My URL' data-width='470' data-num-posts='10'></div>

Thanks!

4

1 に答える 1

1

これを行う唯一の方法は、コメント ボックスごとに一意の URL を割り当てることです。それらが同じページにある場合でも、次のようなものを使用できます。

http://www.example.com/#comments1
http://www.example.com/#comments2
http://www.example.com/#comments3
...
于 2012-12-13T16:42:30.623 に答える