]> source.dussan.org Git - jquery.git/commitdiff
Add a try/catch to handle the exception thrown by unloaded iframes in IE. Fixes ...
authorJohn Resig <jeresig@gmail.com>
Thu, 10 Dec 2009 00:00:59 +0000 (16:00 -0800)
committerJohn Resig <jeresig@gmail.com>
Thu, 10 Dec 2009 00:00:59 +0000 (16:00 -0800)
src/event.js

index afe92af595f05ea4d399cf828f434ed22e8d6b77..f7668965fe580c55f894ce7f0bd378c68a31921e 100644 (file)
@@ -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) {}
                }
        }
 });