我正在尝试根据JQuery $.get请求的结果确定函数的返回值:
有没有简单的方法来做这件事?
function checkResults(value) {
$.get("checkDuplicates.php", {
value: value
}, function(data) {
if(data == "0") {
//I want the "checkResults" function to return true if this is true
} else {
//I want the "checkResults" function to return false otherwise
}
});
}
有没有简单的方法来做这件事?