Skip to content
Permalink
Browse files

Only need to declare the data once.

  • Loading branch information...
jeresig committed Oct 22, 2010
1 parent 4fcfee4 commit 0174518a49e86e3f479eaf916a68b64a1e662a4f
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/data.js
@@ -134,9 +134,9 @@ jQuery.extend({

jQuery.fn.extend({
data: function( key, value ) {
if ( typeof key === "undefined" ) {
var data = null;
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 ) {

1 comment on commit 0174518

@jitter

This comment has been minimized.

Copy link
Contributor

commented on 0174518 Oct 22, 2010

#7239 can be closed now (?)

Please sign in to comment.
You can’t perform that action at this time.