mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Closes #741: Remove $("body") case in favor of $(document.body).
This commit is contained in:
committed by
Rick Waldron waldron.rick@gmail.com
parent
376e0d9fa8
commit
532ba250a9
13
src/core.js
13
src/core.js
@@ -90,15 +90,6 @@ jQuery.fn = jQuery.prototype = {
|
||||
return this;
|
||||
}
|
||||
|
||||
// The body element only exists once, optimize finding it
|
||||
if ( selector === "body" && !context && document.body ) {
|
||||
this.context = document;
|
||||
this[0] = document.body;
|
||||
this.selector = selector;
|
||||
this.length = 1;
|
||||
return this;
|
||||
}
|
||||
|
||||
// Handle HTML strings
|
||||
if ( typeof selector === "string" ) {
|
||||
// Are we dealing with HTML string or an ID?
|
||||
@@ -132,7 +123,7 @@ jQuery.fn = jQuery.prototype = {
|
||||
}
|
||||
|
||||
} else {
|
||||
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
|
||||
ret = jQuery.buildFragment( [ match[1] ], doc );
|
||||
selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
|
||||
}
|
||||
|
||||
@@ -200,7 +191,7 @@ jQuery.fn = jQuery.prototype = {
|
||||
},
|
||||
|
||||
toArray: function() {
|
||||
return slice.call( this, 0 );
|
||||
return slice.call( this );
|
||||
},
|
||||
|
||||
// Get the Nth element in the matched element set OR
|
||||
|
||||
Reference in New Issue
Block a user