Bug Tracker

Ticket #3108: unbind-unload[5757].diff

File unbind-unload[5757].diff, 681 bytes (added by flesler, 12 years ago)
  • trunk/jquery/src/event.js

     
    604604// And prevent errors on refresh with events like mouseover in other browsers
    605605// Window isn't included so as not to unbind existing unload events
    606 jQuery(window).bind("unload", function() {
    607         jQuery("*").add(document).unbind();
    608 });
     606jQuery( window ).bind( 'unload', function(){
     607        for ( var id in jQuery.cache )
     608                // Skip the window
     609                if ( id != 1 && jQuery.cache[ id ].handle )
     610                        jQuery.event.remove( jQuery.cache[ id ].handle.elem );
     611});