Discussion Locked

Delay in Javascript

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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?

3 replies

by sunilguptasg

Basically the idea that the function could call itself on the setTimeout helped and solved the issue I was facing.

Thanks.

This discussion is closed to new replies.