Ajax request returns 200 OK, but an error event is fired instead of success

后端 未结 16 2325
难免孤独
难免孤独 2020-11-22 04:12

I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns 200 OK, but jQuery execut

16条回答
  •  爱一瞬间的悲伤
    2020-11-22 04:17

    I've had some good luck with using multiple, space-separated dataTypes (jQuery 1.5+). As in:

    $.ajax({
        type: 'POST',
        url: 'Jqueryoperation.aspx?Operation=DeleteRow',
        contentType: 'application/json; charset=utf-8',
        data: json,
        dataType: 'text json',
        cache: false,
        success: AjaxSucceeded,
        error: AjaxFailed
    });
    

提交回复
热议问题