On 14 juil, 16:03, Thiago Dantas <[email protected]> wrote:
> 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 )

Unless you're still using GWT 1.5, the up-to-date doc is here
http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideBootstrap

>  How the JAVASCRIPT knows that the document is "ready" to begin
> onModuleLoad function ( step 10 ) ?

Depending on the browser:
 - using the DOMContentLoaded event
 - using a timer and checking the document.readyState value
The template is here:
http://code.google.com/p/google-web-toolkit/source/browse/trunk/dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js#285

>  The "ready" state is reached after all scripts be loaded and
> evaluated, how do that using javascript,i.e, how execute a function
> after all script tags be loaded ?

Just include a <script> after another <script>, the second one is
guaranteed to be executed after the first has been downloaded (if
external) and executed (example: load a library,then use it).
But in this case, as suggested in the doc, the *browser* communicates
that the document is "ready" (DOMContentLoaded fires, or
document.readyState is either loaded or complete) only when all
scripts are loaded and executed. This is because a script can
document.write() to generate content in the document, that affects how
it is parsed! (<b><script>document.write('</b>');</script>foo closes
the <b> so foo is not bold; <script>document.write('<b>')</script>foo</
b> makes foo bold; run the same with javascript disabled and look at
how different things are)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to