When a web application running and on close the browser window then which event raise?
+1
A:
onunload is the event raised when closing the browser window.
How ever this event isn't fired only when closing the browser, that's just one case.
Brian Gianforcaro
2008-11-25 11:22:25
you also can't depend on it 100% of the time. If the browser crashes then it won't be sent.
tloach
2008-11-25 11:27:00
@tloach: if the browser crashes your options are limited
orip
2008-11-25 11:44:43
A:
The web browser doesn't send any notification to the web server when the user closer the window.
Tim
2008-11-25 11:23:11
+1
A:
See existing topic:
http://stackoverflow.com/questions/299679/java-servlet-how-to-detect-browser-closing
Diodeus
2008-11-25 14:04:51
A:
See my answer at the thread pointed by Diodeus: basically, you cannot... Lot of browsers just no longer fire onbeforeunload and/or onunload. And even when they do, it is hard to distinguish between page reload, page jump and browser/window/tab closing.
PhiLho
2008-11-25 14:17:17