It's not a secret anymore!
The moose likes HTML, CSS and JavaScript and the fly likes setTimeout() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "setTimeout()" Watch "setTimeout()" New topic


Shiva.Om Kumar
Ranch Hand

Joined: Jun 14, 2010
Posts: 68

if save() method is called, I need to check if user responded to confirm at line no. 1 with in one minute or after one minute.
But above code does not work, even if user clicks after one minute at line 1.
first save() method is performed completely than only oneMinPassed becomes true.

I am avoiding using client machine clock (I meant trying to avoid, new Date(); & reason is what if user change the time after getting alert message at line no. 1).
Otherwise if I use following, it works.

Any suggestion?
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Because the confirm halts all code execution.

Shiva.Om Kumar
Ranch Hand

Joined: Jun 14, 2010
Posts: 68
thanks a lot for reply.
Seems there is no solution to this issue & I have to follow second approach.
I agree. Here's the link:
subject: setTimeout()
It's not a secret anymore!