2
I created this function in order to abstract the calls $.ajax()
to be performed at various different times. One of its parameters is the name of one of the functions I would like to be performed in case of success.
However, how should I make the call to this "callback"?
function submitData(myCallback) {
$.ajax({
success: function(res){
myCallback(res);
}
});
}
function processarResponse(response) {
}
Finishing with the help received from Valdeir Psr: the passage of the parameter 'myCallback' must be done passing the name and signature of the callback:
submitData(processarResponse(response));
Thanks for editing; I liked your concision.
– jCintra