【发布时间】:2014-07-24 02:46:39
【问题描述】:
我正在使用 jquery 进行 AJAX 调用,该调用返回 HTTP 500 错误。在 Firefox 中工作正常,但 IE 报告 200 错误。我知道 PHP 是正确的,因为如果我直接进入该页面,它会显示为 500 错误。只是 jQuery 部分在 IE 中不起作用。
这里是 ajax 调用:
$.ajax({
url: "download.php",
data: {
removefile: filename
},
type: "GET",
dataType: "html",
success: function(html) {
alert("Success");
},
error: function(xhr, status, errorThrown) {
alert("Error: " + xhr.status);
},
complete: function(xhr, status) {
alert("Complete: " + xhr.status);
}
});
我使用的 php 类似于:
header($_SERVER['SERVER_PROTOCOL'] . " 500 Internal Server Error", true, 500);
echo "Remove failed";
我在 IE 9 上进行测试,但尝试了所有不同的兼容模式,但都遇到了同样的问题。
有什么想法吗?
【问题讨论】:
标签: javascript php jquery ajax internet-explorer