Skip to content

Commit

Permalink
Make sure that the body element exists before doing the body selector…
Browse files Browse the repository at this point in the history
… optimization. Fixes #6529.
  • Loading branch information
jeresig committed Sep 24, 2010
1 parent 5c05504 commit e0a9615
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.js
Expand Up @@ -91,7 +91,7 @@ jQuery.fn = jQuery.prototype = {
}

// The body element only exists once, optimize finding it
if ( selector === "body" && !context ) {
if ( selector === "body" && !context && document.body ) {
this.context = document;
this[0] = document.body;
this.selector = "body";
Expand Down

0 comments on commit e0a9615

Please sign in to comment.