File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes detect closing IE browser 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 "detect closing IE browser" Watch "detect closing IE browser" New topic
Author

detect closing IE browser

gino jersey
Greenhorn

Joined: May 24, 2005
Posts: 21
Our app uses struts, and it uses the onunload event:


The code catches users when they click on "Home" in Internet Explorer. A pop up dialog shows , and they are asked if they really want to exit or return to the application.

It was also the case when a users tries to close the browser by clicking the X in the upper right hand corner, the pop up dialog comes up to confirm.

The problem now is that when the user clicks the small X to close the browser the main browser just closes, the dialog pops up (which is by now useless because there is no application to return to). This was working til a feww days ago and suddenly it is not.

We are investiagting if there is anyting in IE settings that could affect this behavior.

Another option we are looking at is the onbeforeunload event.
Seems to work when I put it in one of the pages.
However, when I try to go to the next page within the application (as defined by struts) it also triggers the onbeforeunload event, which we don't want.

Does anyone know how I can get this event to work properly and still keep the flow defined by struts.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: detect closing IE browser
 
Similar Threads
Using onUnload
Using onbeforeunload event of Javascript
Cancelling Window onclose event.
Opening pop up in JavaScript
need to differentiate between the window closing an window refreshing