I read a lot but i think that i'm not getting it.
I read this duplicated post many times, and still can't figure it out how to make work. I working with code from another person and can't go crazy on the code.
How can i get a callback response to use outside the function? This code is in a function, that is in another function.
$.ajax({
method: "POST",
url: "test.php",
data: data
}).done(function(resp){
res = resp;
});
return res;
I get
ReferenceError: res is not defined
return res;