Skip to content

Instantly share code, notes, and snippets.

@rodaine
Created May 15, 2012 13:30
Show Gist options
  • Save rodaine/2701800 to your computer and use it in GitHub Desktop.
Save rodaine/2701800 to your computer and use it in GitHub Desktop.
JavaScript: jQuery Plugin Boilerplate [$.method()]
// based off Nettuts+ article by Jonathan Cutrell:
// "14 Reasons Why Nobody Used Your jQuery Plugin"
// http://goo.gl/yx8up
;(function($, window, undefined){ "use strict";
if (!$.myPlugin) $.myPlugin = function(opts) {
var defaults = {
//plugin defaults
};
var options = $.extend(defaults, opts || {});
//plugin logic...
};
})(jQuery, window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment