Skip to content

Instantly share code, notes, and snippets.

@skoon
Created December 19, 2009 05:04
Show Gist options
  • Save skoon/259963 to your computer and use it in GitHub Desktop.
Save skoon/259963 to your computer and use it in GitHub Desktop.
var foo = {
buttonHandler: function(e) {
if(foo.AjaxState == "Executing") {
foo.AjaxSuccessCallback = function() {foo.buttonHandler.call(e);};
} else {
//button handler code goes here
}
},
MakeAjaxCall: function() {
foo.AjaxState = "Executing";
},
Ajaxsuccess: function(e) {
foo.AjaxState = "Done";
},
AjaxState: "",
AjaxsuccessCallback: null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment