Volker,

Thank you so much.

So if I wanted to include the script from a file (it's pretty big);
currently the problematic version is done with <t:script file=

Any suggestions?

John 

-----Original Message-----
From: Volker Weber [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 18, 2006 2:01 PM
To: MyFaces Discussion
Subject: Re: [myFaces-Tobago] - how to execute JavaScript file ONLY
after DOM is fully rendered.

Hi John,

you can do a loop with setTimeout() waiting for Tobago.pageIsComplete
becomes true. And you can use <t:script> to insert your script into
page.

like this:

<t:script>
  function doAferLoading() {
    if (!Tobago.pageIsComplete) {
      setTimeout("doAfterLoading()", 50);
    } else {
       // your script code
    }
  }

  doAfterLoading();
</t:script>

the value of Tobago.pageIsComplete is set to true by the tobago init
script after the initializing of the page is completed.

regards,
    Volker

2006/9/18, John <[EMAIL PROTECTED]>:
>
>
> This has caused a never ending headache for us (particularly with IE),

> when JavaScript starts to manipulate the DOM and objects aren't
complete yet.
> Can't use <t:script> obviously.
>
>
> What is the best practice?
>
> Example?
>
> Thanks,
> John

Reply via email to