Ajax post being aborted by firefox (not seen in Chrome or IE)

前端 未结 8 499
再見小時候
再見小時候 2020-12-06 04:37

When using firefox, an ajax post request i have is being reported as aborted in firebug. The ajax post works fine in IE and Chrome. It is not a cross domain request. I tr

8条回答
  •  抹茶落季
    2020-12-06 05:28

    What type of content your server returning. JSON or HTML content. Are you using charset=utf-8 in server content. Make sure your server response must be in JSON contentType. Another guess remove datatype: "html" from your code. Try for your luck.

    If your server returns json means, try below

    $.ajax({
                type: 'POST',
                url: '/Save',
                data: JSON.stringify(dataset),
                datatype: "json",
                contentType: "application/json",
                success: function (data, textStatus, jqXHR) {
                    //alert("success");
                },
                error: function (jqXHR, textStatus, errorThrown) {
                    //alert("error");
                }
            });
    

    datatype: "json", contentType: "application/json" makes sense

提交回复
热议问题