Skip to content

Instantly share code, notes, and snippets.

@j0lvera
Created February 26, 2013 22:44
Show Gist options
  • Save j0lvera/5043056 to your computer and use it in GitHub Desktop.
Save j0lvera/5043056 to your computer and use it in GitHub Desktop.
JS pattern by Chris Coyier
var s,
app = {
settings: {
numArticles: 5,
articleList: $("#article-list"),
moreButton: $("#more-button")
},
init: function() {
s = this.settings;
this.bindUIActions();
},
bindUIActions: function() {
s.moreButton.on("click", function() {
app.getMoreArticles(s.numArticles);
});
},
getMoreArticles: function(numToGet) {
// $.ajax or something
// using numToGet as param
}
};
app.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment