Skip to content

Instantly share code, notes, and snippets.

@Orion98MC
Created September 14, 2011 14:29
Show Gist options
  • Save Orion98MC/1216714 to your computer and use it in GitHub Desktop.
Save Orion98MC/1216714 to your computer and use it in GitHub Desktop.
(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