[Javascript] Order of script-processing

SkyScanner skyscanner at eircom.net
Mon Sep 26 13:16:57 CDT 2005


MessageThe setTimeout argument is actually in milliseconds, not seconds. It works in the right order only if I use 2 timers - one of the querks of JS! The image-hide runs after the slow routine, no matter how long it takes. 

Tim in Ireland
  ----- Original Message ----- 
  From: Glenn E. Lanier, II 
  To: '[JavaScript List]' 
  Sent: Monday, September 26, 2005 2:51 PM
  Subject: RE: [Javascript] Order of script-processing


  I read your flow as three separate routines:

  show()
  SetTimer(slow(),5); // Start in 5 seconds.
  SetTimer(hide(),10); // Start in 10 seconds.

  What I am suggesting is only one timer:

  show()
  SetTimer(slow(), 5);

  slow()
  {
  .....

  hide();
  }

  That way, if slow takes 30 seconds, then the image isn't hidden early.

  --G
    -----Original Message-----
    From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of SkyScanner
    Sent: Monday, September 26, 2005 8:44 AM
    To: [JavaScript List]
    Subject: Re: [Javascript] Order of script-processing


    Huh? That's exactly what I did do...  show:slow:hide

    Tim in Ireland.
      ----- Original Message ----- 
      From: Glenn E. Lanier, II 
      To: '[JavaScript List]' 
      Sent: Monday, September 26, 2005 1:52 PM
      Subject: RE: [Javascript] Order of script-processing
      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. 


--------------------------------------------------------------------------


      _______________________________________________
      Javascript mailing list
      Javascript at LaTech.edu
      https://lists.LaTech.edu/mailman/listinfo/javascript



------------------------------------------------------------------------------


  _______________________________________________
  Javascript mailing list
  Javascript at LaTech.edu
  https://lists.LaTech.edu/mailman/listinfo/javascript
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20050926/f5f5592c/attachment.htm>


More information about the Javascript mailing list