aboutsummaryrefslogtreecommitdiffstats
path: root/src/core.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-09-24 15:53:38 -0400
committerjeresig <jeresig@gmail.com>2010-09-24 15:53:38 -0400
commite0a9615f82fcdad73de6db42a995eb2a5550e361 (patch)
tree13b9e5d9bfa338be7462901d455b7a3317ac3547 /src/core.js
parent5c055040d3685b2e01ee1ad06e403a3856f4c8b0 (diff)
downloadjquery-e0a9615f82fcdad73de6db42a995eb2a5550e361.tar.gz
jquery-e0a9615f82fcdad73de6db42a995eb2a5550e361.zip
Make sure that the body element exists before doing the body selector optimization. Fixes #6529.
Diffstat (limited to 'src/core.js')
-rw-r--r--src/core.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core.js b/src/core.js
index 6c6d00601..cc921385d 100644
--- a/src/core.js
+++ b/src/core.js
@@ -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";