diff options
author | John Resig <jeresig@gmail.com> | 2009-07-22 15:03:23 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-07-22 15:03:23 +0000 |
commit | 6fc57be843e2120ee6361af45b38d12a8c876f40 (patch) | |
tree | ce54be4b2b0a16b83ee97a1b1280849ec66fe21a /src/event.js | |
parent | fe80b5af45049d1c8d10682eb1075f838d52a045 (diff) | |
download | jquery-6fc57be843e2120ee6361af45b38d12a8c876f40.tar.gz jquery-6fc57be843e2120ee6361af45b38d12a8c876f40.zip |
Support dynamically loaded copies of jQuery using document ready. Fixes #4889.
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/event.js b/src/event.js index 9c1f28734..8eaf44ef5 100644 --- a/src/event.js +++ b/src/event.js @@ -715,6 +715,12 @@ function bindReady() { if ( readyBound ) return; readyBound = true; + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + return jQuery.ready(); + } + // Mozilla, Opera and webkit nightlies currently support this event if ( document.addEventListener ) { // Use the handy event callback |