This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "setTimeout()" Watch "setTimeout()" New topic
Author

setTimeout()

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
author
Rancher

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

Eric
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.
 
 
subject: setTimeout()