I created this function in order to abstract the $.ajax()
calls to be executed at several different times. One of its parameters is the name of one of the functions that I would like it to run on success.
However, how should I call this "callback"?
function submitData(myCallback) {
$.ajax({
success: function(res){
myCallback(res);
}
});
}
function processarResponse(response) {
}
Finishing with the help received from Valdeir Psr: Passing the parameter 'myCallback' must be done by passing the name and signature of the callback:
submitData(processarResponse(response));