File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Alert Box problem in javascript 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 "Alert Box problem in javascript" Watch "Alert Box problem in javascript" New topic

Alert Box problem in javascript

Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hello Ranchers ,

I have a huge application in which there are alerts everywhere on displaying actions of user defined by the application. This application was designed quite some years back and the problem statement is ,

We have a logout code in one of our htm files in which we have written that if the user screen does not do anything for 10 minutes , it should auomatically logout that particular user and bring the user back to login screen. This works like a dream.. ! But the problem is , if the user has an alert message on the screen , then the logout event itself doesnt get fired. I want to know what are the possible solutions through which i can close all the windows and then fire the logout event.

I searched on google quite a lot of time but did not yield any affirmative replies nor forums who can provide solution and so Ranch is the place now i have turned up to and i am sure i would not get the same plain old answer saying this cannot be done.

Please help me as this is a pain both for me and the application users.

Thanks in advance.
Yogendra N Joshi.

Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
There is nothing you can do about that. The windowed alerts halt the execution of JavaScript and there is no way to close them after a set period of time. The server should be doing the timeout anyway so the next user action should result in a login screen.

I agree. Here's the link:
subject: Alert Box problem in javascript
It's not a secret anymore!