From: jeresig Date: Fri, 24 Sep 2010 19:53:38 +0000 (-0400) Subject: Make sure that the body element exists before doing the body selector optimization... X-Git-Tag: 1.4.3rc1~65 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e0a9615f82fcdad73de6db42a995eb2a5550e361;p=jquery.git Make sure that the body element exists before doing the body selector optimization. Fixes #6529. --- 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";