• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setTimeout()

 
Shiva.Om Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the confirm halts all code execution.

Eric
 
Shiva.Om Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot for reply.
Seems there is no solution to this issue & I have to follow second approach.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic