How to get the jQuery $.ajax error response text?

前端 未结 11 1742
野的像风
野的像风 2020-11-22 14:17

I am sending an error response to my jQuery. However, I can not get the response text (in the example below this would be Gone to the beach)

The onl

11条回答
  •  迷失自我
    2020-11-22 14:22

    you can try it too:

    $(document).ajaxError(
        function (event, jqXHR, ajaxSettings, thrownError) {
            alert('[event:' + event + '], [jqXHR:' + jqXHR + '], [ajaxSettings:' + ajaxSettings + '], [thrownError:' + thrownError + '])');
        });
    

提交回复
热议问题