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 username_not_duplicate(username) {
var function_name = "get_username";
var parameters = [username];
var url = "/get_functions.php?function_name=" + function_name + "¶meters=" + parameters;
$.getJSON(url, function(user_name) {
if (user_name == true) {
return true;
}
});
return false;
}