Tag Archives: Facebook

Add a Facebook Like button to your page

Adding a “Like” button using the Facebook JavaScript API is easy:

<div>
        &lt;fb:like href=&quot;"&gt;
    </div>
 
        window.fbAsyncInit = function () {
            FB.init({ appId: 'your app id', status: true, cookie: true,
                xfbml: true
            });
        };
        (function () {
            var e = document.createElement('script'); e.async = true;
            e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
            document.getElementById('fb-root').appendChild(e);
        } ());