Hello,
I have a JavaScript function inside which I use jQuery .post, and I wanted to return a boolean in the fallback:
function is_available() {
$.post('ajax', {
action: 'mail'
}, function(data) {
if ($.trim(data) == 'NO_ERROR') {
return true;
} else {
return false;
}
});
}
but the function returns undefinied. How could I return that boolean?