git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50d78e7
)
Added an optimization for the case where $("body") is used.
author
John Resig
<jeresig@gmail.com>
Mon, 7 Sep 2009 17:20:38 +0000
(17:20 +0000)
committer
John Resig
<jeresig@gmail.com>
Mon, 7 Sep 2009 17:20:38 +0000
(17:20 +0000)
src/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
c8b5a46
..
5ccf158
100644
(file)
--- a/
src/core.js
+++ b/
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;