Created
September 14, 2011 13:54
-
-
Save Orion98MC/1216614 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() { | |
} | |
var Widget = function (elementId, options) { | |
this.scope = "bar"; | |
this.bar = function() { }; | |
}; | |
Widget.prototype.foo = function() { return this.scope }; | |
// 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