title: load and execute order of scripts
body: <p>There are so many different ways to include JavaScript in a html page. I know about the following options:</p>
  
  <ul>
  <li>inline code or loaded from external URI</li>
  <li>included in &lt;head> or &lt;body> tag [<a href="https://stackoverflow.com/questions/1213281/does-javascript-have-to-be-in-the-head-tags">1</a>,<a href="https://stackoverflow.com/questions/1362039/style-and-script-tags-in-html-body-why-notder">2</a>]</li>
  <li>having none, <code>defer</code> or <code>async</code> attribute (only external scripts)</li>
  <li>included in static source or added dynamically by other scripts (at different parse states, with different methods)</li>
  </ul>
  
  <p>Not counting browserscripts from the harddisk, javascript:URIs and <code>onEvent</code>-attributes [<a href="http://docstore.mik.ua/orelly/webprog/jscript/ch12_02.htm" rel="noreferrer">3</a>], there are already 16 alternatives to get JS executed and I'm sure I forgot something.</p>
  
  <p>I'm not so concerned with fast (parallel) loading, I'm more curious about the execution order (which may depend on loading order and <a href="http://docstore.mik.ua/orelly/webprog/jscript/ch12_03.htm" rel="noreferrer">document order</a>). <strong>Is there a good</strong> (cross-browser) <strong>reference that covers really all cases?</strong> E.g. <a href="http://www.websiteoptimization.com/speed/tweak/defer/" rel="noreferrer">http://www.websiteoptimization.com/speed/tweak/defer/</a> only deals with 6 of them, and tests mostly old browsers.</p>
  
  <p>As I fear there's not, here is my specific question: I've got some (external) head scripts for initialisation and script loading. Then I've got two static, inline scripts in the end of the body. The first one lets the script loader dynamically append another script element (referencing external js) to the body. The second of the static, inline scripts wants to use js from the added, external script. Can it rely on the other having been executed (and why :-)?</p>