title: If an image has an onload that calls a function defined in an async script, is there a chance of race condition?
body: <p>I have a script in the header that's set to load "async":</p>
  
  <pre><code>&lt;script src="/scripts/myscript.js" async&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I also have an image on the page that calls a function when it loads:</p>
  
  <pre><code>&lt;img onload="MyObject.start()" src="/images/img.jpg" /&gt;
  </code></pre>
  
  <p>While my initial tests have all ran without issue, that doesn't guarantee me that there isn't a race condition and a possibility of the script loading too late.</p>
  
  <p>Is there a requirement/standard that guarantees the <code>async</code> loaded script will be parsed prior to anything that needs it (or at least prior to image <code>onload</code> being called)?</p>