I need to execute some Javascript code in my page but only after the page has loaded completely. Is there a way to tell in Javascript if the page has completely loaded?
DreXor: in some situations this may fail. Example: function1() refers to page element that hasn't loaded yet ( APPLET/EMBED/IMG/LINK ). These elements can generate asynchronous HTTP requests and there are no guarantees they will download in 300ms. I know, make it 1000 or something
Dynamic changes of document structure (DOM appendChild(), innerHTML/innerText) used in body onload may cause issues you mentioned.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.