]> source.dussan.org Git - jquery.git/commitdiff
Make sure that the body element exists before doing the body selector optimization...
authorjeresig <jeresig@gmail.com>
Fri, 24 Sep 2010 19:53:38 +0000 (15:53 -0400)
committerjeresig <jeresig@gmail.com>
Fri, 24 Sep 2010 19:53:38 +0000 (15:53 -0400)
src/core.js

index 6c6d006014c05628105dcd39b08c2571a7394642..cc921385d939141b02320050851ea0cf4b78dfa5 100644 (file)
@@ -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";