* 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 <p onload="alert('Hello');">Hello</p>
* @result alert('Hello');
*
* @name load
+ * @private
* @type jQuery
* @cat Events/Browser
*/
/**
* @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) {
* $(document)[event]();
*
* // assert count
- * @test ok( count == 6, 'Checking event ' + event);
+ * ok( count == 6, 'Checking event ' + event);
* }
*
* @private
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);
+ }
+});