]> source.dussan.org Git - jquery.git/commitdiff
Land Rich's fix for not using window.top to do frame detection. Fixes #4787.
authorRich Dougherty <rich@rd.gen.nz>
Wed, 11 Nov 2009 18:56:39 +0000 (13:56 -0500)
committerJohn Resig <jeresig@gmail.com>
Wed, 11 Nov 2009 18:56:39 +0000 (13:56 -0500)
src/event.js

index e2087cc13cbdf77f7ff59056aeda292793458ced..1468d0c59b3947fac0fdebec0a9407555a5e0d7e 100644 (file)
@@ -849,10 +849,15 @@ function bindReady() {
                        }
                });
 
-               // If IE and not an iframe
+               // If IE and not a frame
                // continually check to see if the document is ready
-               // NOTE: DO NOT CHANGE TO ===, FAILS IN IE.
-               if ( document.documentElement.doScroll && window == window.top ) (function() {
+               var toplevel = false;
+
+               try {
+                       toplevel = window.frameElement === undefined;
+               } catch(e){}
+
+               if ( document.documentElement.doScroll && toplevel ) (function() {
                        if ( jQuery.isReady ) {
                                return;
                        }