Skip to content

Instantly share code, notes, and snippets.

@andershaig
Last active December 19, 2015 20:18
Show Gist options
  • Select an option

  • Save andershaig/6012165 to your computer and use it in GitHub Desktop.

Select an option

Save andershaig/6012165 to your computer and use it in GitHub Desktop.
Remap jQuery to $
(function ($, SampleNamespace, undefined) {
SampleNamespace.publicMethod = function () {
// Do something public
};
var privateMethod = function () {
// Do something private
};
$(document).ready( function () {
// Do whatever you want and use jQuery as you usually would here,
// e.g.
SampleNamespace.publicMethod();
});
}(jQuery, window.SampleNamespace = window.SampleNamespace || {}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment