Commit 6fc57be8 authored by John Resig's avatar John Resig

Support dynamically loaded copies of jQuery using document ready. Fixes #4889.

parent fe80b5af
...@@ -715,6 +715,12 @@ function bindReady() { ...@@ -715,6 +715,12 @@ function bindReady() {
if ( readyBound ) return; if ( readyBound ) return;
readyBound = true; 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 // Mozilla, Opera and webkit nightlies currently support this event
if ( document.addEventListener ) { if ( document.addEventListener ) {
// Use the handy event callback // Use the handy event callback
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment