Take the 2-minute tour ×

Do i need both of these, as the facebook like button developer page isn't very clear:

like button - (i'm assuming Javascript SDK is brought in this way)

  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  fjs.parentNode.insertBefore(js, fjs);

and the sdk code:

  window.fbAsyncInit = function() {
      appId      : 'YOUR_APP_ID', // App ID
      status     : true, // check login status
      xfbml      : true  // parse XFBML

    // Additional initialization code here

  // Load the SDK Asynchronously
     js.src = "//connect.facebook.net/en_US/all.js";
share|improve this question

1 Answer 1

up vote 0 down vote accepted

No, you don't need both of them. The first code with the Like button code:


is enough.

When in doubt: Like Button

share|improve this answer
not using like box, but like button - and that's where I got the code. it just isn't very clear. –  Jason Feb 3 '12 at 16:21
Thanks, I missed that. I think it's clear enough, just use the code you were given and you'll be fine. If it's not clear for you, you can always test both and see by yourself –  Soufiane Hassou Feb 3 '12 at 16:26

Your Answer


