aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.js
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-07-16 07:32:25 +0000
committerYehuda Katz <wycats@gmail.com>2009-07-16 07:32:25 +0000
commitd36d224cc52e70d837306d33a03f517ef72abc60 (patch)
treeb8d2f7845e661de16e1abec081fb749fe95a0ef8 /src/data.js
parent8e54b167cf60a6efa0e572d31f3886c3cfe74c0b (diff)
downloadjquery-d36d224cc52e70d837306d33a03f517ef72abc60.tar.gz
jquery-d36d224cc52e70d837306d33a03f517ef72abc60.zip
Implemented .data() to get the entire data object. Closes #4284
Diffstat (limited to 'src/data.js')
-rw-r--r--src/data.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/data.js b/src/data.js
index bf54e7526..1d5fe8954 100644
--- a/src/data.js
+++ b/src/data.js
@@ -23,6 +23,8 @@ jQuery.extend({
if ( data !== undefined )
jQuery.cache[ id ][ name ] = data;
+ if(name === true) return jQuery.cache[ id ]
+
// Return the named cache data, or the ID for the element
return name ?
jQuery.cache[ id ][ name ] :
@@ -98,6 +100,8 @@ jQuery.extend({
jQuery.fn.extend({
data: function( key, value ){
+ if(typeof key === "undefined" && this.length) return jQuery.data(this[0], true);
+
var parts = key.split(".");
parts[1] = parts[1] ? "." + parts[1] : "";