🌐 AI搜索 & 代理 主页
Skip to content

Commit 262fcf7

Browse files
committed
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.
1 parent 24e18d4 commit 262fcf7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/event.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,10 @@ jQuery.extend({
791791
ready: function() {
792792
// Make sure that the DOM is not already loaded
793793
if ( !jQuery.isReady ) {
794+
if ( !document.body ) {
795+
return setTimeout( jQuery.ready, 13 );
796+
}
797+
794798
// Remember that the DOM is ready
795799
jQuery.isReady = true;
796800

0 commit comments

Comments
 (0)