Skip to content

Instantly share code, notes, and snippets.

@icodejs
Created November 24, 2012 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icodejs/4141501 to your computer and use it in GitHub Desktop.
Save icodejs/4141501 to your computer and use it in GitHub Desktop.
JS: Template uses AMD or browser globals to create a jQuery plugin.
// Uses AMD or browser globals to create a jQuery plugin.
// It does not try to register in a CommonJS environment since
// jQuery is not likely to run in those environments.
// See jqueryPluginCommonJs.js for that version.
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
$.fn.jqueryPlugin = function () {};
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment