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
a2731202
Commit
a2731202
authored
Sep 14, 2009
by
Ariel Flesler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jquery data: closes #5224. Exposing the expando.
parent
173c1477
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
data.js
src/data.js
+2
-0
data.js
test/unit/data.js
+16
-0
No files found.
src/data.js
View file @
a2731202
...
@@ -2,6 +2,8 @@ var expando = "jQuery" + now(), uuid = 0, windowData = {};
...
@@ -2,6 +2,8 @@ var expando = "jQuery" + now(), uuid = 0, windowData = {};
jQuery
.
extend
({
jQuery
.
extend
({
cache
:
{},
cache
:
{},
expando
:
expando
,
data
:
function
(
elem
,
name
,
data
)
{
data
:
function
(
elem
,
name
,
data
)
{
elem
=
elem
==
window
?
elem
=
elem
==
window
?
...
...
test/unit/data.js
View file @
a2731202
module
(
"data"
);
module
(
"data"
);
test
(
"expando"
,
function
(){
expect
(
4
);
equals
(
"expando"
in
jQuery
,
true
,
"jQuery is exposing the expando"
);
var
obj
=
{};
jQuery
.
data
(
obj
,
"foo"
,
"bar"
);
equals
(
jQuery
.
expando
in
obj
,
true
,
"jQuery.data added an expando to the object"
);
var
id
=
obj
[
jQuery
.
expando
];
equals
(
id
in
jQuery
.
cache
,
true
,
"jQuery.data added an entry to jQuery.cache"
);
equals
(
jQuery
.
cache
[
id
].
foo
,
"bar"
,
"jQuery.data worked correctly"
);
});
test
(
"jQuery.data"
,
function
()
{
test
(
"jQuery.data"
,
function
()
{
expect
(
5
);
expect
(
5
);
var
div
=
jQuery
(
"#foo"
)[
0
];
var
div
=
jQuery
(
"#foo"
)[
0
];
...
...
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