I would like to create a plugin for jquery that doesn’t work with the dom. I therefore don’t need to use a jquery object from the $ function. I would like to make my own function called
$.shortcut(keys,action)
Icould probably just go
$.prototype.shortcut = function(){//my code}
but I would like to know if that’s the best way to go about this.
You just about have it already…
I prefer to wrap mine in an anon function and pass jQuery as a param though. It helps avoid naming conflicts and makes for easier minification.