Created
July 2, 2012 16:31
-
-
Save interfeis/3034115 to your computer and use it in GitHub Desktop.
jQuery module pattern boilerplate
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
var clientName = window.clientName || {}; | |
(function ($, context) { | |
// Add the global variables used across the module | |
var vars = { | |
variable2 : "test" | |
}; | |
/* | |
* Public method that can be used outside of the namespace | |
* Example: clientName.publicMethod(); | |
*/ | |
context.publicMethod = function () { | |
}; | |
//private method | |
function init() { | |
// Insert all logic to initialize the module | |
} | |
// The init will run in the document ready | |
$(init); | |
} (jQuery, clientName)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment