JQuery AJAX Post Not Working On IE8

    xiaoxiao2026-09-09  4

    IE11下这个方法正常

    $.ajax({ type: "POST", url: url, data: JSONData, dataType: "json", success: function (result) { }, error: function (data, status, e) { layer.alert("错误!" + e); } });

    IE8下需要添加content-type和async参数才能正常工作

    $.ajax({ type: "POST", url: url, data: JSONData, dataType: "json", contentType: "application/x-www-form-urlencoded;charset=utf-8", async:false, success: function (result) { }, error: function (data, status, e) { layer.alert("错误!" + e); } });

    转载请注明原文地址: https://ju.6miu.com/read-1311901.html
    最新回复(0)