title: jQuery getScript() vs document.createElement('script')
body: <p>Assuming that both of these approaches load the script properly, and that I wait the appropriate amount of time before using the script (and/or use a callback), what are the major differences between these approaches.</p>
  
  <p><em>Note: I understand the first uses jQuery (which is a larger download etc.). What I'm really interested in is the after affects of these approaches. Does one place the script in a different scope than the other? Etc.</em> </p>
  
  <p>jQuery:</p>
  
  <pre><code>function loadScript() {
      $.getScript('http://www.mydomain/myscript.js');
  }
  </code></pre>
  
  <p>Appending to body:</p>
  
  <pre><code>function loadScript() {
     var script= document.createElement('script');
     script.type= 'text/javascript';
     script.src= 'http://www.mydomain/myscript.js';
     script.async = true;
     document.body.appendChild(script);
  }
  </code></pre>
  
  <p>Appending to head:</p>
  
  <pre><code>function loadScript() {
     var head= document.getElementsByTagName('head')[0];
     var script= document.createElement('script');
     script.type= 'text/javascript';
     script.src= 'http://www.mydomain/myscript.js';
     script.async = true;
     head.appendChild(script);
  }
  </code></pre>