if ( data !== undefined )\r
jQuery.cache[ id ][ name ] = data;\r
\r
+ if(name === true) return jQuery.cache[ id ]\r
+\r
// Return the named cache data, or the ID for the element\r
return name ?\r
jQuery.cache[ id ][ name ] :\r
\r
jQuery.fn.extend({\r
data: function( key, value ){\r
+ if(typeof key === "undefined" && this.length) return jQuery.data(this[0], true);\r
+\r
var parts = key.split(".");\r
parts[1] = parts[1] ? "." + parts[1] : "";\r
\r
});\r
\r
test(".data()", function() {\r
+ expect(1);\r
+\r
+ var div = jQuery("#foo");\r
+ div.data("test", "success");\r
+ isObj( div.data(), {test: "success"}, "data() get the entire data object" )\r
+})\r
+\r
+test(".data(String) and .data(String, Object)", function() {\r
expect(22);\r
var div = jQuery("#foo");\r
equals( div.data("test"), undefined, "Check for no data exists" );\r