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
a6f3757d
Commit
a6f3757d
authored
Feb 13, 2010
by
jeresig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Found a better detect for deleting an expando, added back in removeAttribute as it does work in IE.
parent
9195107d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
data.js
src/data.js
+4
-1
manipulation.js
src/manipulation.js
+4
-1
support.js
src/support.js
+9
-10
No files found.
src/data.js
View file @
a6f3757d
...
...
@@ -80,7 +80,10 @@ jQuery.extend({
// Otherwise, we want to remove all of the element's data
}
else
{
if
(
jQuery
.
support
.
deleteExpando
)
{
delete
elem
[
expando
];
delete
elem
[
jQuery
.
expando
];
}
else
if
(
elem
.
removeAttribute
)
{
elem
.
removeAttribute
(
jQuery
.
expando
);
}
// Completely remove the data cache
...
...
src/manipulation.js
View file @
a6f3757d
...
...
@@ -569,7 +569,10 @@ jQuery.extend({
}
if
(
deleteExpando
)
{
delete
elem
[
expando
];
delete
elem
[
jQuery
.
expando
];
}
else
if
(
elem
.
removeAttribute
)
{
elem
.
removeAttribute
(
jQuery
.
expando
);
}
delete
cache
[
id
];
...
...
src/support.js
View file @
a6f3757d
...
...
@@ -81,6 +81,15 @@
delete
window
[
id
];
}
// Test to see if it's possible to delete an expando from an element
// Fails in Internet Explorer
try
{
delete
script
.
test
;
}
catch
(
e
)
{
jQuery
.
support
.
deleteExpando
=
false
;
}
root
.
removeChild
(
script
);
if
(
div
.
attachEvent
&&
div
.
fireEvent
)
{
...
...
@@ -112,16 +121,6 @@
jQuery
.
boxModel
=
jQuery
.
support
.
boxModel
=
div
.
offsetWidth
===
2
;
document
.
body
.
removeChild
(
div
).
style
.
display
=
'none'
;
// Test to see if it's possible to delete an expando from an element
// Fails in Internet Explorer
try
{
div
.
test
=
1
;
delete
doc
.
test
;
}
catch
(
e
)
{
jQuery
.
support
.
deleteExpando
=
false
;
}
div
=
null
;
});
...
...
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