git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe80b5a
)
Support dynamically loaded copies of jQuery using document ready. Fixes #4889.
author
John Resig
<jeresig@gmail.com>
Wed, 22 Jul 2009 15:03:23 +0000
(15:03 +0000)
committer
John Resig
<jeresig@gmail.com>
Wed, 22 Jul 2009 15:03:23 +0000
(15:03 +0000)
src/event.js
patch
|
blob
|
history
diff --git
a/src/event.js
b/src/event.js
index
9c1f287
..
8eaf44e
100644
(file)
--- 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