Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Order of script-processing


  • From: glenn_lanier at netzero.net (Glenn E. Lanier, II)
  • Subject: [Javascript] Order of script-processing
  • Date: Mon Sep 26 07:52:40 2005

From: SkyScanner
Sent: Monday, September 26, 2005 4:31 AM


From: "Peter-Paul Koch" < <mailto:pp.koch@xxxxxxxxx> pp.koch@xxxxxxxxx>
> Most browsers (except Opera) change the visible display of the page
> only when all scripts have exited completely. Solution: use a timeout:

function show()
{
  gif.src = 'pleasewait.gif'; // or whatever
  setTimeout('slow_routine()',10);
}

> Now the script exits after the gif has been set and the browsers show
> it. Then the slow routine kicks in. Result: user sees Please Wait.


 
Hi - I got it working after a bit of experimentation. I found that it would only
work properly if I placed a timeout around the slow routine *and* the hide
routine.
 
 
showGif('icon_5');
setTimeout("slowRoutine()",10);
setTimeout("hideGif('icon_5')",10);
 

 [GEL>] Why don't you move hideGif() to the end of slowRoutine? That way, if it
takes more time on a slower machine, your image isn't hidden early. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.LaTech.edu/pipermail/javascript/attachments/20050926/dc284f1f/attachment.html