Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setTimeOut not working with JS alerts

 
sreenath reddy
Ranch Hand
Posts: 415
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am using setTimeout in my jsp to ping the server repeatedly after some time . The ping should reach the server from the client just to check that the user has kept his browser open

But the strange thing is that when there is an alert in the page say "Are you sure you want to delete ?" comes up in the page with OK and CANCEL buttons . If the user doesn't click any of them setTimeout() is not working . I mean call is not happening from the client to server

is this the limitation of that function ?? i can't use meta tag as i doesn't want my page to be refreshed .

Can any one let me know how to go about this ??
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the confirm stops the execution of anything on the page. It is like a pause button.

Eric
 
sreenath reddy
Ranch Hand
Posts: 415
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any other way of doing this ....by doing some chages in the meta tag atleast
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could always try replacing the alert with a custom popup window or floating div.

-Yuriy
 
sreenath reddy
Ranch Hand
Posts: 415
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi yuriv

I agree that alerts can be replaced with div but my application already has lots of validations which prompt the JS alerts and at this moment its tough to replace them

Ok i have an idea of using meta tag and refreshing the page by having some hidden frame(May be iframe) in that page

Will the meta tag also stop functioning with the alerts on the page ??
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The meta tag should stop working too.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic