Hi, at the moment I have my jQuery plugin running it's logic in if statments.
For example I have:
(function($) {
$.fn.myplugin = function(action) {
if(action == "foo"){
}
if(action == "bar"){
}
if(action == "grapefruits"){
}
}
})(jQuery);
Is there a better way to go about this?
Also the same with event handlers, can I declare them inside the plugin?