Commit 0174518a authored by jeresig's avatar jeresig

Only need to declare the data once.

parent 4fcfee43
......@@ -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 ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment