Commit b7d4e0e4 authored by John Resig's avatar John Resig

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

parent 50d78e76
...@@ -48,6 +48,11 @@ jQuery.fn = jQuery.prototype = { ...@@ -48,6 +48,11 @@ jQuery.fn = jQuery.prototype = {
return this; return this;
} }
// $("body"): Shortcut for quickly finding the body element
if ( selector === "body" && !context && document.body ) {
selector = document.body;
}
// Handle $(DOMElement) // Handle $(DOMElement)
if ( selector.nodeType ) { if ( selector.nodeType ) {
this.context = this[0] = selector; this.context = this[0] = selector;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment