Created
February 17, 2011 09:14
-
-
Save theconektd/831362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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