title: GWT BOOTSTRAP - Question
body: <p>Reading the GWT Bootstrap on Googles page, i have some question.
  (<a href="http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_WhenDoModulesLoad" rel="nofollow noreferrer">http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_WhenDoModulesLoad</a> )</p>
  
  <p>Assumptions:
  Most browsers will allow a maximum of two simultaneous connections for fetching resources.</p>
  
  <p>The HTML Page:</p>
  
  <p><code>
    &lt;html&gt;
       &lt;body onload='alert("w00t!")'&gt;
      &lt;img src='bigImageZero.jpg'&gt;&lt;/img&gt;
      &lt;script source='externalScriptZero.js'&gt;&lt;/script&gt;
      &lt;img src='bigImageOne.jpg'&gt;&lt;/img&gt;
      &lt;img src='reallyBigImageTwo.jpg'&gt;&lt;/img&gt;
      &lt;script src='com.example.app.App.nocache.js'&gt;&lt;/script&gt;
      &lt;script src='externalScriptOne.js'&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></p>
  
  <p>So , the bootstrap is composed of:</p>
  
  <ol>
  <li>The HTML document is fetched and parsing begins.</li>
  <li>Begin fetching bigImageZero.jpg.</li>
  <li>Begin fetching externalScriptZero.js.</li>
  <li>bigImageZero.jpg completes (let's assume). Parsing is blocked until     externalScriptZero.js is done fetching and evaluating.</li>
  <li>externalScriptZero.js completes.</li>
  <li>Begin fetching bigImageOne.jpg and reallyBigImageTwo.jpg simultaneously.</li>
  <li>bigImageOne.jpg completes (let's assume again). com.example.app.App.nocache.js begins fetching and evaluating.</li>
  <li>...nocache.js completes, and the compiled script (...cache.js) begins fetching (this is non-blocking).</li>
  <li>...cache.js completes. onModuleLoad() is not called yet, as we're still waiting on externalScriptOne.js to complete before the document is considered 'ready'.</li>
  <li>externalScriptOne.js completes. The document is ready, so onModuleLoad() fires.</li>
  <li>reallyBigImageTwo.jpg completes.</li>
  <li><p>body.onload() fires, in this case showing an alert() box.</p>
  
  <p><strong>The question:</strong></p>
  
  <p>how the JAVASCRIPT knows that the document is ready to begin onModuleLoad function ( step 10 ) ?</p></li>
  </ol>