Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var $$ = function(param) {
var node = $(param)[0];
var id = $.data(node);
$.cache[id] = $.cache[id] || {};
$.cache[id].node = node;
return $.cache[id];
};
// Now, instead of doing $("#foo").data("foo") and ("#foo").data("foo", "bar"),
// you can do $$("#foo").foo and $$("#foo").foo = bar.
// from: http://yehudakatz.com/2009/04/20/evented-programming-with-jquery/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment