Why can’t I pass a named function to the jquery ajax complete option. Here’s my code:
$.ajax({
type: 'post',
url: baseURL + '/' + controller + '/' + action,
data: params,
success: function(data){
//do something
},
complete: function(jqXHR, textStatus){
checkResponseCode(jqXHR, textStatus);
}
});
I wanted to just write out: “complete: checkResponseCode(jqXHR, textStatus);”
You can pass a function name, but this code is you invoking a function: