我不知道为什么不工作...我使用$.ajax
运行file.php并通过它(POST
)输入值 此文件.PHP工作,但我的AJAX功能不起作用:成功ajax:如果是200状态代码运行功能其他功能
$.ajax({
type: 'POST',
url: 'file.php',
data: { email: $('#andressemail').val() },
success: function(data,status){
if(status === '200'){
newmessage();
}
else{
erroremessage();
}
}
});
funtion newmessage(){
alert('ok');
}
funtion erroremessage(){
alert('no');
}
的file.php工作正常(它在我的通讯增加了一个用户),但$.ajax
不起作用,状态码是不是200
为什么?
试试这个:status =='success' –