Created
November 24, 2012 21:41
-
-
Save icodejs/4141501 to your computer and use it in GitHub Desktop.
JS: Template uses AMD or browser globals to create a jQuery plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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