articles

Home / DeveloperSection / Articles / Integrated Facebook Comment API in your website

Integrated Facebook Comment API in your website

Vijay Shukla 7428 18-May-2013

In this article I am trying to implement Facebook comment API in your website.

Comments Box is a social plug-in that enables user commenting on your site. Features include moderation tools and distribution.

You need to implement the comment box with below link: http://developers.facebook.com/docs/reference/plugins/comments/

After open this link you need to fill below screen will be appear:

Integrated Facebook Comment API in your website

1.       Click on the comment which is under the Social Plugging in left side pane.

2.        URL to Comment: - Here give the URL for comment box.

3.       Width: - Here give the width of the plug-in in pixels.

4.       Numbers of posts: - Here give the numbers of posts to display by default.

5.       Color scheme: - Here give color scheme of the plug-in.

6.       Get Code: - Click on the Get Code button to get the script for plug-in.

After clicking Get Code below screen will appear:

Integrated Facebook Comment API in your website

Copy the code and paste where which you want to set the comment box.

Code: -
<!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>Untitled Page</title>
    <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>
</head>
<body>
    <div class="fb-comments" data-href="http://mindstick.com" data-width="470" data-num-posts="5">
    </div>
</body>
</html>

 

Output:

Integrated Facebook Comment API in your website


Updated 24-Nov-2019

Leave Comment

Comments

Liked By