我下面有这个ajax:
var formValues = $('#login_form').serializeArray();
$.ajax({
type: "POST",
url: "user.php",
data: {
method: 'loginUser',
data: formValues
},
cache: false,
dataType: "json",
success: function (result) {
loading.out();
if (result.status != "COMPLETE") {
return swal("Failed", result.message, "error");
}
else if (result.status == "COMPLETE") {
location.assign(window.location.origin + "/");
}
},
error: function(jqXHR, exception) {
var msg = '';
if (jqXHR.status === 0) {
msg = 'Not connect.\n Verify Network.';
} else if (jqXHR.status == 404) {
msg = 'Requested page not found. [404]';
} else if (jqXHR.status == 500) {
msg = 'Internal Server Error [500].';
} else if (exception === 'parsererror') {
msg = 'Requested JSON parse failed.';
} else if (exception === 'timeout') {
msg = 'Time out error.';
} else if (exception === 'abort') {
msg = 'Ajax request aborted.';
} else {
msg = 'Uncaught Error.\n' + jqXHR.responseText;
}
return swal("Failed", msg, "error");
}
});
这在台式机上运行良好,但是在执行ajax时,特别是在iPhone上的移动设备上,它进入内部错误:function(jqXHR,exception){。我收到内部服务器错误[500]。
有人可以帮忙吗?