Created
May 11, 2011 15:23
-
-
Save davidpadbury/966663 to your computer and use it in GitHub Desktop.
Demonstration of the JavaScript module "pattern"
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
(function(global) { | |
function something() { | |
alert('something from lib1'); | |
} | |
global.something = something; | |
})(window.lib1 = {}); |
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
(function(global) { | |
function something() { | |
alert('something from lib2'); | |
} | |
global.something = something; | |
})(window.lib2 = {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment