I think my program is skipping result of JSON call. Is it possible to make a closure function here or make the program wait for JSON call to return?
function
Drew's answer is nearly perfect, just missing one bracket and comma for IE.
function username_not_duplicate(username) {
var function_name = "get_username";
var parameters = [username];
var url = "camps/includes/get_functions.php?function_name=" + function_name + "¶meters=" + parameters;
var rslt = false;
$.ajax({
async: false,
url: url,
dataType: "json",
success: function(data) {
if (data == true) {
rslt = true;
}
},
});
return rslt;
}