Created
March 23, 2012 18:22
-
-
Save ismyrnow/2173458 to your computer and use it in GitHub Desktop.
Creating a local unobtrusive JS object
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() { | |
... | |
var exampleObject = (function() { | |
var privateVariable = null; | |
function privateMethod() { ... } | |
this.publicMethodOne = function() { ... } | |
this.publicMethodTwo = function() { ... } | |
return this | |
})(); | |
exampleObject.publicMethodOne(); | |
... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment