CORS错误 - 在Chrome中工作但在IE中失败

时间:2016-06-28 11:28:46

标签: javascript jquery ajax google-chrome internet-explorer

我有以下脚本执行ajax调用并尝试重定向到某个url。这里的问题是下面的代码在Chrome中工作正常但在IE中失败。

function LoginSubmit() {
        debugger;

        $('#loginform').validate();

        if ($('#loginform').valid()) {
            myApp.showProgress();
            $.ajax({
                url: "/Authentication/Login",
                type: "POST",
                data: $("form[name=loginform]").serialize(),
                success: function (data) {
                    debugger;
                    $('ConvertInsuredLogin').html("");
                    if (data != null && data.OldAccountNumber) {
                        InsuredLogin(data.OldAccountNumber);
                    }
                    else if (data != null && data.ReturnUrl) {
                        //error line
                        window.location.replace(data.ReturnUrl);
                    }
                    else {
                        var newDoc = document.open("text/html", "replace");
                        newDoc.write(data);
                        newDoc.close();
                    }
                },
                complete: function () { myApp.hideProgress(); }
            });

        }
        return false;
    }

0 个答案:

没有答案