Found a better detect for deleting an expando, added back in removeAttribute as it does work in IE.
This commit is contained in:
parent
9195107dbb
commit
a6f3757d50
|
@ -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;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue