The last line of the code below is the first one to be executed, and I need the function containing this ajax to return true or false, but when I put it to return within success, error or complete it does not work. >
error: function (response) {
if (((response.responseText.split("{")[1]).split("}")[0]).split(":")[1]) {
confirmationValue = true;
} else {
confirmationValue = false;
}
},
complete: function () {
console.log(confirmationValue);
return confirmationValue;
}
});
console.log(confirmationValue);
Thank you!