X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fdata.js;fp=src%2Fdata.js;h=b7a6ab9723c0e91deb1260c435dd986eaee67c79;hb=626624a19a6cbd70b44da08ee2123ba79f8e2bb0;hp=562834aa11dc942f4bbffe9e6b9f27200f03e5f7;hpb=1f667aa035b3e4885d6b35fa9aa4990310f131af;p=jquery.git diff --git a/src/data.js b/src/data.js index 562834a..b7a6ab9 100644 --- a/src/data.js +++ b/src/data.js @@ -129,8 +129,8 @@ jQuery.extend({ jQuery.fn.extend({ data: function( key, value ) { - if ( typeof key === "undefined" && this.length ) { - return jQuery.data( this[0] ); + if ( typeof key === "undefined" ) { + return this.length ? jQuery.data( this[0] ) : null; } else if ( typeof key === "object" ) { return this.each(function() {