First ajax
function testAjax() {
$.ajax({
url: "getvalue.php",
success: function(data) {
callback(data);
//return data;
}
});
}
Callback function
function callback(data) {
return data;
}
Another Ajax that uses data from callback that is from another ajax
$.ajax({
url: "getvalue.php",
success: function(data) {
//how to get the data from callback function to be used here
//return data;
}
});
I have an ajax call from a function and to get the data from that ajax request i have a callback function.
My question is how can I use the data from the callback function to be used in my second ajax request?