This commit is contained in:
parent
291b1edf44
commit
faefbb1ad0
3 changed files with 30 additions and 10 deletions
|
@ -9,7 +9,7 @@ jQuery.extend({
|
|||
// Please use with caution
|
||||
uuid: 0,
|
||||
|
||||
// Unique for each copy of jQuery on the page
|
||||
// Unique for each copy of jQuery on the page
|
||||
expando: "jQuery" + jQuery.now(),
|
||||
|
||||
// The following elements throw uncatchable exceptions if you
|
||||
|
@ -21,6 +21,10 @@ jQuery.extend({
|
|||
"applet": true
|
||||
},
|
||||
|
||||
hasData: function( elem ) {
|
||||
return !elem.nodeType || (elem[ jQuery.expando ] && !jQuery.isEmptyObject(jQuery.cache[ elem[jQuery.expando] ]));
|
||||
},
|
||||
|
||||
data: function( elem, name, data ) {
|
||||
if ( !jQuery.acceptData( elem ) ) {
|
||||
return;
|
||||
|
@ -144,7 +148,7 @@ jQuery.fn.extend({
|
|||
var attr = this[0].attributes, name;
|
||||
for ( var i = 0, l = attr.length; i < l; i++ ) {
|
||||
name = attr[i].name;
|
||||
|
||||
|
||||
if ( name.indexOf( "data-" ) === 0 ) {
|
||||
name = name.substr( 5 );
|
||||
dataAttr( this[0], name, data[ name ] );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue