Modify ↓
Ticket #2139 (closed bug: invalid)
$(window).onunload
| Reported by: | qutoz | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.2 |
| Component: | core | Version: | 1.2.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi,
I'm trying to use the unload event handler with jQuery, but it's not working.
There's no error, but it doesn't fire up.
This is my code:
$(window).unload(function(){
alert("foo");
}
)
Attachments
Change History
Changed 5 years ago by alienbrain
-
attachment
compat_unload_fix.patch
added
comment:1 Changed 5 years ago by alienbrain
After some investigation, it turns out that this is a bug in compat-1.0 compatibility plugin.
As it's trying to support the old "un"+event shortcuts, and by doing that it was overriding the unload event when it creates the shortcut for the load event ("un"+"load").
Patch attached above, which fixes this problem. But it would mean that the "un"+"load" shortcut is not available.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Unload event fix for compat-1.0 plugin