I am using the ajax to fetch data from server.
function getData(){
$.ajax({
......,
success: function(resp){
console.log(resp);
return resp;
}
});
}
But when I try
var fetchedData = getData();
Then fetchData is empty.
But when I checked console then there is data.
Can anyone help me?