Delay in Javascript - TechRepublic
General discussion
August 25, 2001 at 06:00 AM
sunilguptasg

Delay in Javascript

by sunilguptasg . Updated 24 years, 8 months ago

At a certain point in a javascript I need to wait for a few seconds. I am unable to do this.

The problem is actually like this:
A parent window spawns a child window which sets a javascript variable of the parent window. Based on the value set, the javascript function needs to perform diffrent tasks. The script needs to wait for some value to be returned. If i do a continous poll of this variable the browser hangs. Also I need to time out this waiting after say 15 seconds, to take care of ainternet diconnect problem.

The onTimer and other functions have been of no help here.

Is there a solution for this?

This discussion is locked

All Comments