Why jQuery consider an 200 response Ajax request with empty content as fail()?

前端 未结 2 1172
温柔的废话
温柔的废话 2020-12-31 06:30

First, there\'s no cross-region problem at all.

I found if the server response an empty content body, jQuery consider this as fail()?

Why is this?

2条回答
  •  感动是毒
    2020-12-31 07:00

    WynandB is correct, however there is an alternate resolution: have the server return HTTP 204 No Content instead, which will make jQuery ignore the parsing error.

提交回复
热议问题