Skip to content
Permalink
Browse files

Found a better detect for deleting an expando, added back in removeAt…

…tribute as it does work in IE.
  • Loading branch information
jeresig committed Feb 13, 2010
1 parent 9195107 commit a6f3757d50f8be021505f4f7fa7201199e8b7f2d
Showing with 17 additions and 12 deletions.
  1. +4 −1 src/data.js
  2. +4 −1 src/manipulation.js
  3. +9 −10 src/support.js
@@ -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
@@ -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 ];
@@ -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;
});

0 comments on commit a6f3757

Please sign in to comment.
You can’t perform that action at this time.