I am facing an issue with assigning my AJAX return as a variable to concatenate.
Here is the sample code:
function FetchSex() {
$.ajax({
url: '/SEX/GetAllSex/',
success: function (responseData) {
console.log(responseData);
}
});
}
function FetchUsers() {
var Pistas = null;
$.ajax({
url: '/Users/GetAllUsers/',
success: function (dataReceived) {
console.log(dataReceived)
}
});
}
The objective is to concatenate the results. Here are the steps I am following:
var SexInfo = GetSex();
var UsersInfo = GetUsers();
var combinedData = UsersInfo.concat(SexInfo);
An error message shows up saying that both SexInfo and UsersInfo variables are undefined!
I find this confusing.
Your help would be greatly appreciated! =)