Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
04524287
Commit
04524287
authored
Dec 10, 2009
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switched jQuery() to represent jQuery([]) instead of jQuery(document).
parent
b846ad4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
core.js
src/core.js
+1
-3
core.js
test/unit/core.js
+1
-1
No files found.
src/core.js
View file @
04524287
// Define a local copy of jQuery
var
jQuery
=
function
(
selector
,
context
)
{
// The jQuery object is actually just the init constructor 'enhanced'
return
arguments
.
length
===
0
?
rootjQuery
:
new
jQuery
.
fn
.
init
(
selector
,
context
);
return
new
jQuery
.
fn
.
init
(
selector
,
context
);
},
// Map over jQuery in case of overwrite
...
...
test/unit/core.js
View file @
04524287
...
...
@@ -16,7 +16,7 @@ test("jQuery()", function() {
// Basic constructor's behavior
equals
(
jQuery
().
length
,
1
,
"jQuery() === jQuery(document
)"
);
equals
(
jQuery
().
length
,
0
,
"jQuery() === jQuery([]
)"
);
equals
(
jQuery
(
undefined
).
length
,
0
,
"jQuery(undefined) === jQuery([])"
);
equals
(
jQuery
(
null
).
length
,
0
,
"jQuery(null) === jQuery([])"
);
equals
(
jQuery
(
""
).
length
,
0
,
"jQuery('') === jQuery([])"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment