Javascript 在ajax帖子之后从IE重定向到另一个页面时出现问题(内部描述)
假设我有两个html页面Javascript 在ajax帖子之后从IE重定向到另一个页面时出现问题(内部描述),javascript,jquery,html,ajax,internet-explorer,Javascript,Jquery,Html,Ajax,Internet Explorer,假设我有两个html页面 index.html info.html index.html包含一个用于查看info.html的注册表单,该表单将注册的详细信息保存到服务器并重定向到info.html页面 它在除Internet explorer之外的所有浏览器上都运行良好。但在IE中,它不会重定向。我正在使用以下代码 function StartService(param) { var ajaxUrl = "/WebService.asmx/Notify"; $.ajax({ t
function StartService(param) {
var ajaxUrl = "/WebService.asmx/Notify";
$.ajax({
type: "POST",
crossDomain: true,
contentType: "application/json; charset=utf-8",
url: ajaxUrl,
data: param,
dataType: "json",
success: successTest,
error: errorTest
});
function successTest(data) {
var result = data.d;
//console.log(result);
if (result === 'success') {
setTimeout(function () { window.location.href = 'info.html'; }, 3000);
} else {
alert(result);
}
}
function errorTest(xhr, textStatus, errorThrown) {
console.log(xhr.responseText);
}
}
请有人帮忙。您是否尝试过在window.location.href语句中使用绝对url
IE可能对此有问题。它记录了什么“console.log(result);”?@JitendraPancholi它记录了“success”您是否尝试使用==而不是==?@JitendraPancholi是的,它不起作用。IE的任何特定版本都会产生问题?