【发布时间】:2016-11-01 16:20:23
【问题描述】:
我在 IE11 中遇到问题,但在 Chrome 或 Firefox 中没有问题。我有一个 Ajax Get 请求嵌套在一个似乎没有触发的 Ajax Post 请求的 Success 函数中。但是,在开发人员工具打开的情况下,它会触发并按预期运行。为什么会这样?
$.ajax({
url: urls.firstUrl,
type: 'POST',
data: { itemId: itemId },
success: function (data) {
$('#aDiv').html(data);
$.ajax({
url: urls.secondUrl,
type: 'GET',
success: function (data) {
$('#aDiv').html(data);
},
error: function (xhr, status, error) {
showErrorAlert(xhr, status, error);
}
});
},
error: function (xhr, status, error) {
showErrorAlert(xhr, status, error);
}
});
【问题讨论】:
-
'Doesn't seem to fire' 不会削减它,添加一些
alert()'s 来测试 IE11 中的行为。让其他人更容易提供帮助。
标签: javascript ajax internet-explorer-11 developer-tools