mirror of
https://github.com/jquery/jquery.git
synced 2026-02-02 08:55:24 -05:00
22 lines
567 B
JavaScript
22 lines
567 B
JavaScript
define([
|
|
"../core"
|
|
], function( jQuery ) {
|
|
|
|
/**
|
|
* Determines whether an object can have data
|
|
*/
|
|
jQuery.acceptData = function( elem ) {
|
|
var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
|
|
nodeType = +elem.nodeType || 1;
|
|
|
|
// Do not set data on non-element DOM nodes because it will not be cleared (#8335).
|
|
return nodeType !== 1 && nodeType !== 9 ?
|
|
false :
|
|
|
|
// Nodes accept data unless otherwise specified; rejection can be conditional
|
|
!noData || noData !== true && elem.getAttribute("classid") === noData;
|
|
};
|
|
|
|
return jQuery.acceptData;
|
|
});
|