X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fevent.js;h=a32f0339c8d9829e7b97b4f888fa9d682e8db588;hb=a5f8a1441158b66efb76de1d15f061f87f7bdc17;hp=afe92af595f05ea4d399cf828f434ed22e8d6b77;hpb=3ec2f1aef6b137d0f639e2fc53f95352d24b9d90;p=jquery.git diff --git a/src/event.js b/src/event.js index afe92af..a32f033 100644 --- a/src/event.js +++ b/src/event.js @@ -885,6 +885,10 @@ jQuery.each( ("blur focus load resize scroll unload click dblclick " + jQuery.fn[ name ] = function( fn ) { return fn ? this.bind( name, fn ) : this.trigger( name ); }; + + if ( jQuery.fnAttr ) { + jQuery.fnAttr[ name ] = true; + } }); // Prevent memory leaks in IE @@ -896,7 +900,10 @@ jQuery( window ).bind( 'unload', function() { for ( var id in jQuery.cache ) { // Skip the window if ( id != 1 && jQuery.cache[ id ].handle ) { - jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + // Try/Catch is to handle iframes being unloaded, see #4280 + try { + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + } catch(e) {} } } });