From: John Resig Date: Thu, 10 Dec 2009 00:00:59 +0000 (-0800) Subject: Add a try/catch to handle the exception thrown by unloaded iframes in IE. Fixes ... X-Git-Tag: 1.4a2~56 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b846ad4ca060a100dec3ace5711f96a083bc4ac3;p=jquery.git Add a try/catch to handle the exception thrown by unloaded iframes in IE. Fixes #4280. --- diff --git a/src/event.js b/src/event.js index afe92af59..f7668965f 100644 --- a/src/event.js +++ b/src/event.js @@ -896,7 +896,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) {} } } });