Skip to content

Instantly share code, notes, and snippets.

@St0iK
Forked from anonymous/gist:3365ed1006d4f382f340
Last active August 29, 2015 14:13
Show Gist options
  • Save St0iK/88fb0262fc71ba4816b7 to your computer and use it in GitHub Desktop.
Save St0iK/88fb0262fc71ba4816b7 to your computer and use it in GitHub Desktop.
var App = {
myProperty : 'someValue',
jqueryVar1 : $('.someClass'),
jqueryVar2 : $('.someOtherClass'),
jqueryVar3 : $('#id'),
myConfig:{
useCaching:true,
language: 'en'
},
myMethod: function(){
console.log('I can haz functionality?');
},
//output a value based on current configuration
myMethod2: function(){
console.log('Caching is:' + (this.myConfig.useCaching)?'enabled':'disabled');
},
};
console.log(App.jqueryVar1);
console.log(App.myConfig.useCaching);
App.myMethod(); //I can haz functionality
App.myMethod2(); //outputs enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment