Created
September 14, 2011 14:29
-
-
Save Orion98MC/1216714 to your computer and use it in GitHub Desktop.
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
(function() { | |
// Module scope | |
var global = this; | |
// Helper functions | |
function foo() { | |
return "module foo"; | |
} | |
var Widget = function (elementId, options) { | |
this.scope = "Foo"; | |
function private_foo() { | |
return "private foo"; | |
} | |
this.bar = function() { return private_foo() }; | |
}; | |
Widget.prototype.foo = function() { return "bar" }; | |
// Make Widget globaly accessible | |
global.Widget = Widget; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment