How to implement the Facebook "Like" button for my website

Posted by vamsivanka on Stack Overflow See other posts from Stack Overflow or by vamsivanka
Published on 2010-05-18T01:26:53Z Indexed on 2010/05/18 1:50 UTC
Read the original article Hit count: 379

Filed under:
|
|

I am trying to implement facebook like button on my website. The first four lines in the code is already there on my site after the end of the "" tag.

To implement the "Like button" i have added the second script (Line five to the end) and ran the application. Its giving me an error as

"Microsoft Jscript runtime error:'_onLoad' is null or not an object"

Please Let me know. Thanks

<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
<script type="text/javascript">
    FB.init("myapikey", "xd_receiver.htm", { "reloadIfSessionStateChanged": true });
</script>
<script type="text/javascript">
  window.fbAsyncInit = function() {
    FB.init({appId: 'myappid', 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>

References: http://developers.facebook.com/docs/reference/plugins/like

<fb:like href="http://webclip.in" layout="standard" show-faces="true" width="450" action="like" font="arial" colorscheme="light"/>

© Stack Overflow or respective owner

Related posts about facebook

Related posts about ASP.NET