X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fevent.js;h=e5f6a453a46eb4e00b5e6fd490ea885bdddb8732;hb=a974b255c30ac23906ba45bf95de99542a70b587;hp=26c56209fa868ff201d201d77f0e76f8ddf6c480;hpb=985856b823b1648bffc3fd63c1faf836d0ddaf7c;p=jquery.git diff --git a/src/event.js b/src/event.js index 26c5620..e5f6a45 100644 --- a/src/event.js +++ b/src/event.js @@ -548,13 +548,13 @@ jQuery.fn.extend({ var proxy = jQuery.event.proxy( fn ); proxy.guid += this.selector + type; - jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy ); + jQuery( this.context ).bind( liveConvert(type, this.selector), this.selector, proxy ); return this; }, die: function( type, fn ){ - jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null ); + jQuery( this.context ).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null ); return this; } }); @@ -677,6 +677,9 @@ jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + // Prevent memory leaks in IE // And prevent errors on refresh with events like mouseover in other browsers // Window isn't included so as not to unbind existing unload events +// More info: +// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ +// - https://bugzilla.mozilla.org/show_bug.cgi?id=252542 jQuery( window ).bind( 'unload', function(){ for ( var id in jQuery.cache ) // Skip the window