tags:

views:

321

answers:

1

I am loading fb api in asynchronous way:

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: 'your app id', 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>

How do I know when it is initialized? What is the replacement for FB.ensureInit() method that would prevent running enclosed code until api is initialized?

+2  A: 
Jawa

related questions