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 Pop up an alert or confirm message when the browser is closed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Pop up an alert or confirm message when the browser is closed" Watch "Pop up an alert or confirm message when the browser is closed" New topic
Author

Pop up an alert or confirm message when the browser is closed

ravisha andar
Ranch Hand

Joined: Feb 25, 2011
Posts: 55
Hi All,

I want to pop up a question(alert) when the window(that is browser ) is closed.
Once the user accepts or clicks on "Yes" the the browser needs to be closed.

Can anybody help me with this.

Any help is highly appreciated !!!

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Not a JSP question at all, so I've moved this to HTML forum.

And if you search around, you will see that the answer is :you can't". There is no reliable way to trail that the browser is being closed.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
window.confirm

Gets prompted for more than closing the windows and there really is no way to detect it.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pop up an alert or confirm message when the browser is closed
 
Similar Threads
Session Time out
can closing a window fire an event
alert problem
Has anybody forund an answer-Browser window closing
Need urgent Help - Browser is hanging