Best use of Facebook SDK + html5 vs xfbml


Staff member
I've implemented the JavaScript SDK in my website as stated on the facebook JavaScript SDK site.:

<div id="fb-root"></div>
  window.fbAsyncInit = function() {
      appId      : 'YOUR_APP_ID', // App ID
      channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML

    // Additional initialization code here

  // Load the SDK Asynchronously
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); = id; js.async = true;
     js.src = "//";
     ref.parentNode.insertBefore(js, ref);

But in the like plugin code section it gives me this code:

<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); = id;
  js.src = "//";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<strong>My 1st question: What is the better code? and are their any differences?</strong>

My second question is about the HTML5 or XFBML rendering of the buttons or comment boxes. I run a wordpress blog, that's not html5.

<strong>My 2nd question: What is the best code to use, the HTML5 or the XFBML? and is one faster that the other, or one less supported than the other?</strong>