I know that I can use callbacks like this:
function foo(mySuccess) {
$.post('handler.ashx', mySuccess);
}
But how would I do in the following scenario:
function foo(){ }
$.post('handler.ashx', function(){
foo.mySuccess = function(data); //this wont work, but you get the idea
});
And then call it using:
foo.mySuccess(function(data){
});
This is under the assumption that the object has an accessible
mySuccessfunction.For example: