Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Showing with 17 additions and 1 deletion.
  1. +16 −0 src/data.js
  2. +1 −1  src/manipulation.js
View
16 src/data.js
@@ -6,7 +6,19 @@ jQuery.extend({
expando:expando,
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ "object": true,
+ "applet": true
+ },
+
data: function( elem, name, data ) {
+ if ( jQuery.noData[elem.nodeNode.toLowerCase()] ) {
+ return;
+ }
+
elem = elem == window ?
windowData :
elem;
@@ -43,6 +55,10 @@ jQuery.extend({
},
removeData: function( elem, name ) {
+ if ( jQuery.noData[elem.nodeNode.toLowerCase()] ) {
+ return;
+ }
+
elem = elem == window ?
windowData :
elem;
View
2  src/manipulation.js
@@ -463,7 +463,7 @@ jQuery.extend({
function cleanData( elems ) {
for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
- if ( (id = elem[expando]) ) {
+ if ( !jQuery.noData[elem.nodeNode.toLowerCase()] && (id = elem[expando]) ) {
delete jQuery.cache[ id ];
}
}

1 comment on commit 5980292

@jeresig

Fixed obvious dumb-ness in ed93204.

Please sign in to comment.
Something went wrong with that request. Please try again.