mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Only need to declare the data once.
This commit is contained in:
parent
4fcfee4369
commit
0174518a49
@ -134,9 +134,9 @@ jQuery.extend({
|
||||
|
||||
jQuery.fn.extend({
|
||||
data: function( key, value ) {
|
||||
if ( typeof key === "undefined" ) {
|
||||
var data = null;
|
||||
|
||||
if ( typeof key === "undefined" ) {
|
||||
if ( this.length ) {
|
||||
var attr = this[0].attributes, name;
|
||||
data = jQuery.data( this[0] );
|
||||
@ -163,7 +163,7 @@ jQuery.fn.extend({
|
||||
parts[1] = parts[1] ? "." + parts[1] : "";
|
||||
|
||||
if ( value === undefined ) {
|
||||
var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
|
||||
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
|
||||
|
||||
// Try to fetch any internally stored data first
|
||||
if ( data === undefined && this.length ) {
|
||||
|
Loading…
Reference in New Issue
Block a user