Wednesday, May 08, 2013

Comments using Facebook on my website

Now Its very Easy to implement comment section on your website using facebook

Put the code At top of your header

<html xmlns:fb="http://ogp.me/ns/fb#">

Inside Body Tag


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

Comments display code

<fb:comments href="http://example.com" width="470" num_posts="10"></fb:comments>

Please Replace http://example.com with your website page,You can also use dynamically.


No comments:

Post a Comment