#fb-root
:javascript
  window.fbAsyncInit = function() {
    FB.init({appId: '#{app_id}', status: true, cookie: true, xfbml: true});
    fbInitHook();
    FB.Canvas.setSize();
  };

  function fbInitHook() {}

  function sizeChangeCallback() {
    FB.Canvas.setSize();
  }

  (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);
  }());
#fb-root
:javascript
  window.fbAsyncInit = function() {
    FB.init({
      appId: '#{app_id}',
      status: true,
      cookie: true,
      xfbml: true
    });
    fbInitHook();
  };

  function sizeChangeCallback() {
    FB.Canvas.setSize();
  }

  (function(d){
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));
Update the FB.init async code
Update the FB.init async code
