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.
This commit is contained in:
parent
24e18d4cae
commit
262fcf7b7b
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue