weixin_33738578 2019-08-09 09:40 采纳率: 0%
浏览 37

AJAX处理错误[重复]

This question already has answers here:
                </div>
            </div>
                    <div class="grid--cell mb0 mt4">
                        <a href="/questions/1637019/how-to-get-the-jquery-ajax-error-response-text" dir="ltr">How to get the jQuery $.ajax error response text?</a>
                            <span class="question-originals-answer-count">
                                (11 answers)
                            </span>
                    </div>
                    <div class="grid--cell mb0 mt4">
                        <a href="/questions/2833951/how-do-i-catch-an-ajax-query-post-error" dir="ltr">How do I catch an Ajax query post error?</a>
                            <span class="question-originals-answer-count">
                                (7 answers)
                            </span>
                    </div>
            <div class="grid--cell mb0 mt8">Closed <span title="2019-08-09 09:40:55Z" class="relativetime">9 months ago</span>.</div>
        </div>
    </aside>

From my backend I wrote a POST api which returns a 403 error if a condition occurs. Together with the 403 error I am also passing a JSON response. In my front end I am using an AJAX request, however I can't seem to be able to read the JSON response when this error occurs. Are there ways to handle/capture the error and then read the JSON response as well ?

I was going to use the .then method however an error still props up without returning the JSON response.

</div>
  • 写回答

0条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 有偿找一份verilog语言的cnn代码带讲解
      • ¥15 关于#mysql#的问题:mysql 组内排名,取各组的销售金额前10
      • ¥15 有人用过颜色传感器吗?
      • ¥50 求一个SQL长料切短料的优化排版算法
      • ¥15 python 删除TXT文档中小写字母
      • ¥15 ValueError: not enough values to unpack (expected 2, got 0)
      • ¥15 js怎么禁止修改域名
      • ¥15 Cursor为什么在Windows11打不开
      • ¥30 java调用javacv遇到的问题
      • ¥15 如何使用matlab画出带宽100Khz,时长100ms信号的LFM形式的时频图啊