I\'m trying to give my plugin callback functionality, and I\'d like for it to operate in a somewhat traditional way:
myPlugin({options}, function() {
/*
Bringing back a blast from the past.
Worth noting that if you have two arguments passed, for example:
$.fn.plugin = function(options, callback) { ... };
Then you call the plugin without the options argument but with a callback then you'll run into issues:
$(selector).plugin(function() {...});
I use this to make it a little more flexible:
if($.isFunction(options)) { callback = options }