diff options
author | John Resig <jeresig@gmail.com> | 2009-11-09 13:47:53 +0100 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-11-09 13:47:53 +0100 |
commit | 262fcf7b7b919da1564509f621cf7480a5d5572b (patch) | |
tree | 12970cd5b241f2e43c72a41d9a1e03d8bb272a24 /src/event.js | |
parent | 24e18d4cae4a1cb1a77323fd2e99300508e55642 (diff) | |
download | jquery-262fcf7b7b919da1564509f621cf7480a5d5572b.tar.gz jquery-262fcf7b7b919da1564509f621cf7480a5d5572b.zip |
Require that, at least, document.body exists before firing the ready event. This may stop jQuery from working on pages that don't create a document.body (such as Safari, when no body exists) but considering that we've required a document.body since 1.3 and haven't broken any pages, this doesn't appear to be a pressing issue. Used the test case written by dmethvin to verify the bug and the fix. Fixes #4320.
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/event.js b/src/event.js index 1b4c539b9..7cfb535b6 100644 --- a/src/event.js +++ b/src/event.js @@ -791,6 +791,10 @@ jQuery.extend({ ready: function() { // Make sure that the DOM is not already loaded if ( !jQuery.isReady ) { + if ( !document.body ) { + return setTimeout( jQuery.ready, 13 ); + } + // Remember that the DOM is ready jQuery.isReady = true; |