Skip to content

Instantly share code, notes, and snippets.

@daveroma
Created May 24, 2016 10:39
Show Gist options
  • Save daveroma/de439ed68c4c1e192b2da066eb8b2900 to your computer and use it in GitHub Desktop.
Save daveroma/de439ed68c4c1e192b2da066eb8b2900 to your computer and use it in GitHub Desktop.
JavaScript structure for static web pages
var App = App || {};
App.home = function() {
function privateFunction() {
return 'Can\'t see meh';
}
return {
init: function() {
// Do it bruh
}
}
}
// init this pages JS on page load
$(function() {
var home = new App.home();
home.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment