mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Conflicts: Gruntfile.js README.md src/ajax.js src/ajax/xhr.js src/attributes.js src/core.js src/css.js src/data.js src/effects.js src/event.js src/manipulation.js src/offset.js src/selector-native.js src/traversing.js test/unit/core.js test/unit/data.js
This commit is contained in:
21
src/data/accepts.js
Normal file
21
src/data/accepts.js
Normal file
@@ -0,0 +1,21 @@
|
||||
define([
|
||||
"../core"
|
||||
], function( jQuery ) {
|
||||
|
||||
/**
|
||||
* Determines whether an object can have data
|
||||
*/
|
||||
jQuery.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
|
||||
return !noData || noData !== true && elem.getAttribute("classid") === noData;
|
||||
};
|
||||
|
||||
return jQuery.acceptData;
|
||||
});
|
||||
Reference in New Issue
Block a user