Reputation: 677
Reading the GWT Bootstrap on Googles page, i have some question. (http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_WhenDoModulesLoad )
Assumptions: Most browsers will allow a maximum of two simultaneous connections for fetching resources.
The HTML Page:
<html>
<body onload='alert("w00t!")'>
<img src='bigImageZero.jpg'></img>
<script source='externalScriptZero.js'></script>
<img src='bigImageOne.jpg'></img>
<img src='reallyBigImageTwo.jpg'></img>
<script src='com.example.app.App.nocache.js'></script>
<script src='externalScriptOne.js'></script>
</body>
</html>
So , the bootstrap is composed of:
body.onload() fires, in this case showing an alert() box.
The question:
how the JAVASCRIPT knows that the document is ready to begin onModuleLoad function ( step 10 ) ?
Upvotes: 3
Views: 1173
Reputation: 24641
either nocache.js or cache.js could add an extra <script>
tag immediately after the last <script>
tag. this extra <script>
tag would not be fetched until all previous <script>
tags are fetched, parsed, and evaluated. then this <script>
tag would be fetched, executed, and evaluated without waiting for any images. the evaluation of this <script>
tag could call onModuleLoad()
and it would not wait for any images so it would happen sooner than body.onload
this is just my theory; i could not verify it in my development server and i have not attempted to verify it on appengine.
Upvotes: 0
Reputation: 13519
From the same page:
<img>
tags are not guaranteed to be done loading when onModuleLoad()
is called.<script>
tags are guaranteed to be done loading when onModuleLoad()
is called.So when onModuleLoad()
is executed the externalScriptOne.js is loaded, it doesn't start before all script tags are loaded.
Upvotes: 2