首页 > 解决方案 > How can I make an AJAX request made in javascript fail on purpose in the debugger to test it?

问题描述

Suppose if I wrote some code to handle the case where the AJAX request fails then how could I test it out? I was wondering if there was a way to make an AJAX request fail on purpose using the Chrome debugger.

标签: javascriptajax

解决方案


您可以使用network throttlingand go offline ,这将使 ajax 调用失败。


推荐阅读