Skip to content
Permalink
Browse files

Added an optimization for the case where $("body") is used.

  • Loading branch information
jeresig committed Sep 7, 2009
1 parent 50d78e7 commit b7d4e0e46cb2cad6f400173cd09ce44d1b8ad04e
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/core.js
@@ -48,6 +48,11 @@ jQuery.fn = jQuery.prototype = {
return this;
}

// $("body"): Shortcut for quickly finding the body element
if ( selector === "body" && !context && document.body ) {
selector = document.body;
}

// Handle $(DOMElement)
if ( selector.nodeType ) {
this.context = this[0] = selector;

0 comments on commit b7d4e0e

Please sign in to comment.
You can’t perform that action at this time.