I am executing a php call from javascript(jQuery), php sript is sending result back. The problem is that these php scripts are taking some time (milliseconds), and java script is not waiting for them to finish, thus variables are not getting initialized with correct values. The code is simple:
$.get("php/validation.php",{'email':email},function(data){
// valid_email now contains true/false
alert(data);
if(data=="true"){
var valid_email = true;}
});
"Uyarı" gerçek baskı ama valid_mail değeri aşağıdaki kodu "false" olarak kabul edilmektedir. Php scriptler çağırıyoruz ve onlar bitmedi kadar beklemek için başka iyi bir yolu var mı?
Prashant