aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Need to capture browser close button in all browsers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Need to capture browser close button in all browsers" Watch "Need to capture browser close button in all browsers" New topic
Author

Need to capture browser close button in all browsers

syruss kumar
Ranch Hand

Joined: Jul 23, 2009
Posts: 93
Hi all,

I have a scenario that i need to clear the user session when he clicks the browser's close button .I have done that by capturing the position of close button in the browser but now i have a problem that i have tried in IE 6,7,8 .The application is working fine in 6 but not in 7,8.The position of close button may have changed .

How can i get to know that user has clicked the close button in all browsers like IE 6,7,8 and firefox?

Thanks in advance.


All search starts with beginner's luck and all search ends with victor's severly tested.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Not going to happen, not going to happen. What about browser errors, lost internet connections, ctrl-w, ctrl-alt-delete, user typing different address, etc? You can not catch all of the ways to close the browser window. You can not make a web application act like a client application. If you want to try to do it : some code Eric
syruss kumar
Ranch Hand

Joined: Jul 23, 2009
Posts: 93
Thanks a lot Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to capture browser close button in all browsers