When a web application running and on close the browser window then which event raise?
Asked
Active
Viewed 2,416 times
4 Answers
1
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
- 26,564
- 11
- 58
- 77
-
you also can't depend on it 100% of the time. If the browser crashes then it won't be sent. – tloach Nov 25 '08 at 11:27
-
@tloach: if the browser crashes your options are limited – orip Nov 25 '08 at 11:44
0
The web browser doesn't send any notification to the web server when the user closer the window.

Tim
- 813
- 5
- 14
0
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
- 40,535
- 6
- 96
- 134