From bf71575bb4f37321b71ef8ce21c8208ad2b192da Mon Sep 17 00:00:00 2001 From: Rich Dougherty Date: Wed, 11 Nov 2009 13:56:39 -0500 Subject: [PATCH] Land Rich's fix for not using window.top to do frame detection. Fixes #4787. --- src/event.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/event.js b/src/event.js index e2087cc13..1468d0c59 100644 --- a/src/event.js +++ b/src/event.js @@ -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; } -- 2.39.5