title: Is there a way to detect if the Facebook Javascript SDK loaded successfully?
body: <p>I use Facebook as the membership system of my website. It uses the  code to generate a login control, allowing users to login via their facebook account. It's essentially one click if they're already a member, 2 if they're not (for granting permissions).</p>
  
  <p>I got a problem though... feedback is suggesting the login button isn't always loading correctly. Instead of loading the facebook login control, it simply states (in text) "login via facebook" - which is what the login button would say if the control loaded successfully.</p>
  
  <p>Testing shows that is what happens when the facebook javascript SDK fails to load completely (for whatever reason). I've seen instances where a # in the url prevents the SDK from loading.</p>
  
  <p>To better support this issue, how would I go about detecting if the facebook javascript SDK loaded, and is ready? That way, if it fails, I can leave some sort of note for the user.</p>
  
  <p>Here's how it's currently added to the page:</p>
  
  <pre><code>&lt;script&gt;
  window.fbAsyncInit = function () {
  FB.init({
    appId: '***************',
    status: true,
    cookie: true,
    xfbml: true
  });
  FB.Event.subscribe('auth.login', function (response) {
    window.location.reload();
  });
  
  };
  (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);
  } ());
  
  &lt;/script&gt;
  </code></pre>