Created
June 13, 2013 16:31
-
-
Save CatTail/5775182 to your computer and use it in GitHub Desktop.
Provide a way to preserve module with different versions.
This file contains hidden or 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
| 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