Ticket #3015 (closed enhancement: fixed)
Restrict onunload removal of eventhandlers to IE and Firefox 2
| Reported by: | JeroenH | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.3 |
| Component: | event | Version: | 1.2.6 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
In event.js the last lines remove registered eventhandlers on unload in all browsers. This is needed for IE's memory leaks and initially only targeted IE. In #1911 this was changed to apply to all browsers, but the only other browser in need of a fix there was Firefox 2.
This change breaks fast history navigation in Opera (and also in Firefox).
When testing the testcase in #1911, I can reproduce the problem in FF2, but it does not appear anymore in FF3.
It would be better to restrict this change to the browsers that need the fix:
// Prevent memory leaks in IE
// And prevent errors on refresh with events like mouseover in mozilla < 1.9
// Window isn't included so as not to unbind existing unload events
if (jQuery.browser.msie || (jQuery.browser.mozilla && parseFloat(jQuery.browser.version) < 1.9) ){
jQuery(window).bind("unload", function() {
jQuery("*").add(document).unbind();
});
}
Change History
comment:1 Changed 5 years ago by flesler
- Owner set to brandon
- Type changed from bug to enhancement
- Component changed from core to event
comment:4 Changed 4 years ago by JeroenH
This got fixed somewhere, by adding conditional comments for IE.
comment:5 Changed 4 years ago by sylvain
This was fixed in ticket:5198 (changeset:6551).
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
