title: Load javascript sequentially from javascript code
body: <p>I have a javascript widget that is included in a page by inserting a single script tag (as the application should be easiliy distributable):</p>
  
  <pre><code>&lt;script type="text/javascript" src="loadMyWidget.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>loadMyWidget.js then needs to load multiple script files, which has to run in a certain sequence. I've tried to load them async by inserting script elements into the DOM, but that doesn't give me control of the sequence.</p>
  
  <p>I also tried using head.js which is great for modern browsers, but I can't get it to work in IE7 and 8.</p>
  
  <p>Minifying the scripts into one file is unfortunately difficult, as it is composed of a number of files from different projects and I wouldn't know when to update the script.</p>
  
  <p>As simple as it seems, I need to load javascript files from javascript code in a certain sequence and get it to work in all browsers, including IE7 and 8.</p>