Skip to content

Instantly share code, notes, and snippets.

@eightbitraptor
Created January 31, 2012 17:16
Show Gist options
  • Save eightbitraptor/1711668 to your computer and use it in GitHub Desktop.
Save eightbitraptor/1711668 to your computer and use it in GitHub Desktop.
js
Application = {}
jQuery(function($) {
for( key in Application) {
if( Application.hasOwnProperty(key)) {
if (typeof Application[key]["init"] === "function" && $('body').hasClass('with-js-' + key.toLowerCase())){
Application[key].init($)
}
};
};
}
(function(){
Application = {
init: function(){
// page load initialisation code
},
method_name: function(args){
//foo
},
more_methods: function(){
// bar
}
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment