SyntaxHighlighter

2010/05/04

Facebook Like Button Installed on Blogger

Facebook Cookbook: Building Applications to Grow Your Facebook EmpireI really hope Blogger supports the Facebook Like Button like the Amazon associate function to increase social ability between Blogger (Google) and Facebook.

Until then, we can add the button by ourselves.

What we have to do is
  1. Include the Facebook JavaScript library.
  2. Add the Facebook button.
Actually, including the Facebook JavaScript library is not necessary if we use a raw IFRAME tag. However fb tags is easier to use.

To do all, it is the easiest way to create a gadget for Facebook on Blogger.

  1. Open your dashboard of blogger, then add a gadget of HTML/Javascript.
  2. Write the following code with your favorite title name for the gadget.



    <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({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);
      }());
    </script>
    <fb:like layout="standard" show_faces="false" 
      width="450" action="like" colorscheme="light">
    </fb:like>
    
  3. Save all

Then you will see your Facebook like button. If you change the attribute 'show_faces' in 'fb' tag into true, it will use more space.

And please push the button on this page! :)

0 件のコメント: