aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes setTimeOut not working with JS alerts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "setTimeOut not working with JS alerts" Watch "setTimeOut not working with JS alerts" New topic
Author

setTimeOut not working with JS alerts

sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
the confirm stops the execution of anything on the page. It is like a pause button.

Eric
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Is there any other way of doing this ....by doing some chages in the meta tag atleast
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
You could always try replacing the alert with a custom popup window or floating div.

-Yuriy
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
The meta tag should stop working too.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setTimeOut not working with JS alerts
 
Similar Threads
Need to pause javascript
ping IP from JSP page and show result in client's command prompt
AJAX with servlets
Client/Server Communication Problem
Pinging server through javascript(Using XMLrequest)