[Javascript] Order of script-processing

SkyScanner skyscanner at eircom.net
Sun Sep 25 03:31:08 CDT 2005


I seem to remember that in the past we have talked about the order that JS
actually processes its commands, and the results are not always what you
might expect.

I've just come across that now, and can't work out a way to fix it. I have a
very slow routine that takes about 5 seconds to process even on a P4 2.4Ghz
machine. My idea was to have a 'loading - please wait' gif who's visibility
is initially set to 'hidden'. At the crucial point, I would make the gif
visible, do the routine, then make the gif 'hidden' once more.

However, when I initiate this process by clicking on a button, the gif
doesn't display at all. Hmm - why would that be? Removing the 'make the gif
hidden once again' code reveals that when the button is clicked, the gif is
not made visible until the slow routine has completed, which means there's
no point in doing it! This occurs even though the code is

show_the_gif();
slow_routine();
hide_the_gif();


Any thoughts ?

Tim in Ireland.




More information about the Javascript mailing list