Skip to content

Instantly share code, notes, and snippets.

@CatTail
Created June 13, 2013 16:31
Show Gist options
  • Save CatTail/5775182 to your computer and use it in GitHub Desktop.
Save CatTail/5775182 to your computer and use it in GitHub Desktop.
Provide a way to preserve module with different versions.
var module = {};
// global on the server, window in the browser
var root, previous_module;
root = this;
if (root != null) {
previous_module = root.module;
}
module.noConflict = function () {
root.module = previous_module;
return module;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment