Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在ajax帖子之后从IE重定向到另一个页面时出现问题(内部描述)_Javascript_Jquery_Html_Ajax_Internet Explorer - Fatal编程技术网

Javascript 在ajax帖子之后从IE重定向到另一个页面时出现问题(内部描述)

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

假设我有两个html页面

  • index.html
  • info.html
  • index.html包含一个用于查看info.html的注册表单,该表单将注册的详细信息保存到服务器并重定向到info.html页面

    它在除Internet explorer之外的所有浏览器上都运行良好。但在IE中,它不会重定向。我正在使用以下代码

    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的任何特定版本都会产生问题?