The official jQuery resource seems to indicate that you create a static method for your plugin using $.fn.plugin.staticMethod
but that means that your public API requires calling $.fn.plugin.staticMethod()
, which I find cumbersome.
Is there anything wrong with defining $.fn.plugin
for your plugin and $.plugin.staticMethod
for your static method, and what's the difference?
Further, what's the difference between:
$.extend({
plugin : {
staticMethod : function(){ }
}
});
and
$.plugin = {
staticMethod : function(){ }
};