search

Home  >  Q&A  >  body text

javascript - Help! Is there an error in Jquery's $.ajax in IE8?

There is no problem in other browsers, but there will be problems in IE8, jump directly to the error of $.ajax, and the readyState returned by alert is 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:

typechotypecho2709 days ago759

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-06-14 10:55:54

    It is possible that an error was reported in your success callback function.

    reply
    0
  • Cancelreply