diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/data.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/data.js b/src/data.js index d5a25ff6c..eaa483813 100644 --- a/src/data.js +++ b/src/data.js @@ -223,6 +223,11 @@ jQuery.extend({ // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { + // Do not set data on non-element because it will not be cleared (#8335). + if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { + return false; + } + var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional |