Skip to content

Instantly share code, notes, and snippets.

@andrewjamesford
Created June 5, 2012 21:38
Show Gist options
  • Save andrewjamesford/2878228 to your computer and use it in GitHub Desktop.
Save andrewjamesford/2878228 to your computer and use it in GitHub Desktop.
jQuery Modular Template
var ModuleName = {
init: function () {
this.cacheElements();
this.bindEvents();
},
cacheElements: function () {
this.$elementName = $('#element');
},
bindEvents: function () {
this.$elementName.on('click', this.methodName)
},
methodName: function () {
// method body
}
};
ModuleName.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment