Basically I am trying to call a function (function 1) that gets results from another function (function 2). And this function 2 makes an ajax call.
So, the code will be like this:
function f1 () {
var results = f2();
}
function f2() {
$.ajax({
type: 'POST',
url: '/test.php',
success: function(msg){
}
});
}
I know that I show a warning in the function of success, I get the results. But how can we bring this result back?
I tried to do something like this inside function 2 without success:
return msg;
thanks for the help
source
share