title: Loading external javascript in google chrome extension
body: <p>I'm writing a Google Chrome extension which manipulates the current page (basically adds a button).</p>
  
  <p>In my content script, I want to load the Facebook Graph API:</p>
  
  <pre><code>$fbDiv = $(document.createElement('div')).attr('id', 'fb-root');
  $fbScript = $(document.createElement('script')).attr('src', 'https://connect.facebook.net/en_US/all.js');
  $(body).append($fbDiv);
  $(body).append($fbScript);
  
  console.log("fbScript: " + typeof $fbScript.get(0));
  console.log("fbScript parent: " + typeof $fbScript.parent().get(0));
  console.log("find through body: " + typeof $(body).find($fbScript.get(0)).get(0));
  </code></pre>
  
  <p>However, the script doesn't seem to added to <code>body</code>. Here's the console log:</p>
  
  <pre><code>fbScript: object
  fbScript parent: undefined
  find through body: undefined
  </code></pre>
  
  <p>Any ideas on what I'm doing wrong?</p>