DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   Dalying Javascript code execution order (http://www.daniweb.com/forums/thread122540.html)

sampathw May 5th, 2008 8:29 am
Dalying Javascript code execution order
 
Hello,

I'm developing a web theme. Before the last div tag(Which simply has an image), I have added a java script which is calling a remote server for an image output. the last div tag image doesn't get loaded until the javascript execution completes. Please let me know a way to change this order ( load the javascript after the last image is loaded) as the whole design looks bad due to this problem. :(

Thanks in advance

~s.o.s~ May 8th, 2008 1:35 pm
Re: Dalying Javascript code execution order
 
Place the block of Javascript code *after* the DIV tag and things should work out fine. It problems still persist, consider attaching a listener to the onload event handler of the window object which would execute the required Javascript only after the entire page has loaded.

sampathw May 9th, 2008 3:18 am
Re: Dalying Javascript code execution order
 
Hello,
Thank you very much for your advice. It works. thanks a lot!


All times are GMT -4. The time now is 1:44 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC