3
我試圖確定基於一個jQuery $不用彷徨請求的結果的函數的返回值:
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
}
});
}
有沒有簡單的方法來做到這一點?