作者:娜一刻冻杰幸福 | 来源:互联网 | 2023-05-17 18:34
Iamusingfollowingmethodtocallthephp:我使用以下方法来调用php:functionvalidateEmaiAjax(email){v
I am using following method to call the php:
我使用以下方法来调用php:
function validateEmaiAjax(email){
val = null;
$("#warning").load("https://localhost/Continental%20Tourism/register_ajax.php",{email: email}, function(rspns, stat, xml){
val = rspns;
});
if(val == ".")
return true;
else {
return false;
}
}
my php code is:
我的PHP代码是:
0)
echo "Email address exists!";
else
echo ".";
?>
Basically this do check the database and if email exists shows "Email address exists!" if not I want to return true
(so I echo "." and compare it). The weird thing is if i put a break point using firebug near if(val == ".")
program works correctly and returns true. If I remove that break point function always return false. I cant understand why this happens. Please help! Thanks.
基本上这会检查数据库,如果存在电子邮件显示“存在电子邮件地址!”如果不是我想要返回true(所以我回应“。”并进行比较)。奇怪的是,如果我使用firebug附近的断点if(val ==“。”)程序正常工作并返回true。如果我删除该断点函数总是返回false。我不明白为什么会这样。请帮忙!谢谢。
4 个解决方案