Gravatar Setting TimeOut is not good idea - speaking generaly you don't really know when the page will be ready.
One option could be registering event handler for the body.onload event either at the BODY start tag, or in your script with document.body.onload += your_function_here;
Or, as you say using 3rd parties - for example jQuery has the beautiful:
$(document).ready(function(){
// your function body here
// and you are 100% sure that
// this function will be executed
// when the entire DOM is populated
}


Gravatar I totaly agree. That is why I wrote that I do not recomend it. It is still a solution though.
What if you do not have this fance jQuery for example


Gravatar Almost every Javascript framework has onDomReady event, however if you do not use such the simple solution is to put the call to the function at the bottom of the HTML (before the closing body tag). This means that when the function is called the DOM tree is built


Gravatar Thanks Peter,

the javascript is generated in control buried deep down in ASP.NET control hierarchy. Putting it at the end of the document is not an option.

Is there a way to handle the onDomReady event with the MS AJAX framework?


Gravatar http://weblogs.asp.net/stephenwa...ion- events.aspx

here at the bottom of the article there are two ways suggested:

1. Dean Edwards onDomReady function
2. Using ScriptManager


Gravatar Thanks,

very nice article!


Gravatar Really very useful one. Thanks.




Name:

Email:

URL:

Comment:  ? 

 

Commenting by HaloScan