我正在尝试处理从 php 脚本发送的错误。这是我的代码:
<script>
$(document).ready(function() {
$('#signUpForm').submit(function() {
$.ajax({
type: 'POST',
url: "process.php",
data: $("#signUpForm").serialize(),
success: function(data) {
if ((data == "Incorect email format.") || (data == "Username must be between 6-32 signs and only include 0-9, A-Z characters.") || (data == "Password must be between 8-32 signs and only include 0-9, A-Z characters.") || (data == "Passwords do not match.") || (data == "Username is taken, please try another one.")) {
$('#errors').show();
$('#errors').html(data);
} else {
window.location.href = "http://localhost:8888";
}
}
});
return false;
});
});
</script>
Firebug 显示已发送响应,但未显示错误。哪里可能有问题?谢谢。