首页  >  问答  >  正文

javascript - 求助!IE8中Jquery的$.ajax出现错误?

在其他浏览器中没有问题,但是在IE8中就会出现问题,直接跳到$.ajax的error,alert返回的readyState为0

    $.ajax({
            type: "POST",
            async: false,
            contentType: "application/x-www-form-urlencoded;charset=UTF-8",
            xhrFields: {
                withCredentials: true
            },
            url:url,
            data:data,
            success:function (response) {
                arr = response.Data.ListData;
            },
            error:function (XMLHttpRequest, textStatus, errorThrown) {
                alert(XMLHttpRequest.readyState);
            }
        });

readyState:

typechotypecho2658 天前703

全部回复(1)我来回复

  • ringa_lee

    ringa_lee2017-06-14 10:55:54

    有可能是你success的回调函数中报错了。

    回复
    0
  • 取消回复