I have the below jquery deferred logic.
var $qCallA = callA();
var $qCallB = callB();
$.when($qCallA,$qCallB).then(function () {
$("#spinnerDiv").removeClass('spinner show');
});
function callA() {
return $.getJSON("/callA", function (data) {
if (data.status === "success") {
buildTable1(data);
}
});
}
function callB() {
return $.getJSON("/callB", function (data) {
if (data.status === "success") {
buildTable2(data);
}
});
}
I want to return false for $.getJSON call based on response from the backend json. For example , if the data.status == "failure" then I want to return "false" for getJSON . How to achieve this?
Thanks