Skip to content

Instantly share code, notes, and snippets.

@calvinf
Created July 8, 2010 21:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calvinf/468626 to your computer and use it in GitHub Desktop.
Save calvinf/468626 to your computer and use it in GitHub Desktop.
jQuery Plugin Stub
;(function($) {
$.fn.myPlugin = function(options) {
var defaults = {
};
var options = $.extend(defaults, options);
function log(message) { /* debug function */
if (console && console.log) {
console.log(message);
}
}
return this.each(function(){
var $this = $(this);
});
};
})(jQuery);
@calvinf
Copy link
Author

calvinf commented Jul 8, 2010

This is my take on an initial jQuery plugin stub. Inspiration taken from a variety of sources including: http://www.learningjquery.com/2007/10/a-plugin-development-pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment