jquery deferred and return false based on server response
<p>I have the below jquery deferred logic.</p>

<pre><code>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);
        }
    });
}
</code></pre>

<p>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?</p>

<p>Thanks</p>