Added an optimization for the case where $("body") is used.
This commit is contained in:
parent
50d78e7658
commit
b7d4e0e46c
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue