Show Mobile Navigation

Ads

Thursday, 9 May 2013

,

Facebook Comments plugin for Website and Blog

Unknown - Thursday, May 09, 2013
Comments are easily shared with friends or with people who like your Page on Facebook. If a user leaves the “Post to Facebook” box checked when she posts a comment, a story appears on her friends News Feed indicating that she’s made a comment on your website, which will also link back to your site. Friends and people who like the Page can then respond to the discussion by liking or replying to the comment directly in the News Feed on Facebook or in the Comments Box on your site. Threads stay synced across Facebook and on the Comments Box on your site regardless of where the comment was made.
Step 1: Copy and paste the below code after <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>

Step 2: Change YOUR WEB PAGE URL and Place the code for your comments plugin wherever you want the comments to appear on your page.
<div class="fb-comments" data-href="YOUR WEB PAGE URL" data-width="470" data-num-posts="10"></div>

Step 3: Finally whole HTML code like the below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>facebook comments plugin Demo | mobiappsweb.com</title>
  </head>
<body>
<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>
<br />
<strong>Facebook Comment Plugin Demo</strong><br />
<div class="fb-comments" data-href="YOUR WEBPAGE URL" data-width="470" data-num-posts="10"></div>
</body>
</html>

0 comments:

Post a Comment