This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes onunload and onbeforeunload 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 "onunload and onbeforeunload" Watch "onunload and onbeforeunload" New topic

onunload and onbeforeunload

Mark Butcher
Ranch Hand

Joined: Jun 28, 2012
Posts: 46
window.onload is recognised by the opera browser but onunload and onbeforeunload are not.
The javascript function is called on onload but not on onunload and onbeforeunload.

All other browsers are fine with this but except opera.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60800

Please post an SSCCE (Short Self-Contained Correct Example) demonstrating the issue.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: onunload and onbeforeunload
Similar Threads
Invalidation HttpSession upon closing the browser
onUnload() -- Very URGENT !!!
Handle window close event
how to cancel the unload event in a jsp
'Cancel' on alert doesn't stop the action