There is an Ajax request in the function
function Check_production(order_number){ var result = false; $.ajax({ url: "load/check_production.php", cache: false, async: false, data: {zakaz_number:zakaz_number}, type: 'POST', success: function(data){ if (data == "true"){ result = true; }else { result = false; } } }); return result;
}
Is it possible to make it more beautiful without turning off an asynchronous request / local variable / in some other way so that Check_production returns the result?