title: Good practice method for loading JavaScript via ajax
body: <p>Disclaimer: I'm fairly new to AJAX!</p>
  
  <p>I've looked around, and I'm not sure which method to use to load javascript using ajax.</p>
  
  <p>I'm using ajax to request pages that each require their own 6-10 short methods. In total there will be maybe 5-6 of these pages, so an approximate total of 35+ methods.</p>
  
  <p>I would prefer to access necessary javascript as each page that requires it loads.</p>
  
  <p>I've seen a few methods, and I'm not sure which one would best suit my needs:</p>
  
  <ol>
  <li><p>Include an empty script element in the head, and manipulate the src attribute via. the DOM.</p></li>
  <li><p>Create a new script element via. the DOM and append it to the document.body (this sounds the same as #1).</p></li>
  <li>jQuery (which I'm already using) has an ajax getScript() method.</li>
  <li>I haven't read anything about it, but can I just include a script element as part of the ajax response?</li>
  </ol>
  
  <p>As I'm new to ajax and web development in general, I'm curious as to the ups and downs of each method as well as any methods I've missed.</p>
  
  <p>Some concerns are:
  -Will a cached copy be used or will the script download each time an ajax request is made. Note that the scripts will be static.
  -Browser compatibility. I use Chrome, but this app will be used across versions of IE >= 7 as well as Firefox.</p>