我已经在服务器中托管了我的asp.net mvc 4应用程序,该应用程序在chrome,mozilla中运行良好,但它在IE 10和IE 11中不起作用。此外,当我在调试模式下运行时,应用程序可以正常使用IE。这里我的登录方法包含一个ajax调用。 我的ajax电话是这样的
$.ajax({
url: window.contexthttproot + "/Report/ReportLocation",
type: 'POST',
datatype: "json",
contentType: "application/json; charset=utf-8",
cache: false,
data: json,
success: function (items) {
window.location.replace("/LandingPage/Landing");
setTimeout(function () {
$('#spinner').fadeOut(35000);
})
},
error: function (xhr, status) {
}
});
ajax调用有问题吗?
答案 0 :(得分:0)
也许是因为:
datatype: "json"
应该是:
dataType: "json"
这是区分大小写的。
答案 1 :(得分:0)
我认为window.location.replace
不适用于IE
试试这个
window.location.href = '/LandingPage/Landing';
答案 2 :(得分:0)
您的代码中存在一些问题,原因可能是:
window.location.replace("/LandingPage/Landing");
setTimeout(function () {
$('#spinner').fadeOut(35000);
})
将其更改为:
setTimeout(function(){alert("Hello")},3000);