Skip to content

Instantly share code, notes, and snippets.

@ericbutera
Created May 30, 2012 20:05
Show Gist options
  • Save ericbutera/2838607 to your computer and use it in GitHub Desktop.
Save ericbutera/2838607 to your computer and use it in GitHub Desktop.
(function($){
var button = {
el: function() {
return ("#button");
},
result: function(data) {
this.el().enabled();
console.log("data %o", data);
},
fetch: function() {
$.get("/", $.proxy(this.result, this));
},
clicked: function() {
this.el().disable();
this.fetch();
},
init: function() {
this.el().click($.proxy(this.clicked, this));
}
};
$(function(){
button.init();
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment