X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fevent%2Fevent.js;h=186fa0daeb4fe189b54e9814476b20548272ed9d;hb=7654d3b833c0161aacc66abd6d861f53f9d8c395;hp=ff1d936fd70bddbc5b19abbf2b9237cf506a9cb6;hpb=394334671cd4a0b22c01f724b30933fc83df863d;p=jquery.git diff --git a/src/event/event.js b/src/event/event.js index ff1d936..186fa0d 100644 --- a/src/event/event.js +++ b/src/event/event.js @@ -720,11 +720,15 @@ new function(){ * Trigger the load event of each matched element. This causes all of the functions * that have been bound to thet load event to be executed. * + * Marked as private: Calling load() without arguments throws exception because the ajax load + * does not handle it. + * * @example $("p").load(); * @before

Hello

* @result alert('Hello'); * * @name load + * @private * @type jQuery * @cat Events/Browser */ @@ -1521,7 +1525,8 @@ new function(){ /** * @test var count; - * var e = ("blur,focus,load,resize,scroll,unload,click,dblclick," + + * // ignore load + * var e = ("blur,focus,resize,scroll,unload,click,dblclick," + * "mousedown,mouseup,mousemove,mouseover,mouseout,change,reset,select," + * "submit,keydown,keypress,keyup,error").split(","); * var handler1 = function(event) { @@ -1554,7 +1559,7 @@ new function(){ * $(document)[event](); * * // assert count - * @test ok( count == 6, 'Checking event ' + event); + * ok( count == 6, 'Checking event ' + event); * } * * @private @@ -1646,3 +1651,12 @@ new function(){ jQuery.event.add( window, "load", jQuery.ready ); }; + +// Clean up after IE to avoid memory leaks +if ($.browser.msie) $(window).unload(function() { + var event = jQuery.event, global = event.global; + for (var type in global) { + var els = global[type], i = els.length; + if (i>0) do event.remove(els[i-1], type); while (--i); + } +});