How to clear ajax requests from network tab using jquery?(如何使用 jquery 从网络选项卡中清除 ajax 请求?)
问题描述
我需要在任何事件(如按钮单击或使用时间间隔)上使用 jquery 清除网络选项卡中的 ajax 请求.这可能吗?
I need to clear the ajax requests from network tab using jquery on any event like button click or using time interval. Is this possible?
推荐答案
如果你的意思是浏览器开发工具中的网络选项卡,那么不,你无法通过 Javascript 控制它.开发工具是浏览器的一部分,而不是网页的一部分,因此 Javascript 对它们一无所知.
If you mean the network tab in the browser's dev tools, then no, you cannot control it from Javascript. The dev tools are part of the browser and not part of the webpage, so Javascript has no knowledge of them.
这与您的问题没有直接关系,但这证明您想要做的事情是非常不可能的:
This isn't directly related to your question, but this is evidence that the kind of thing you're looking to do would be very much not possible:
我们只允许显式打开开发工具.
We only allow explicit devtools opening.
https://bugs.chromium.org/p/chromium/问题/详细信息?id=112277
这篇关于如何使用 jquery 从网络选项卡中清除 ajax 请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 jquery 从网络选项卡中清除 ajax 请求?


- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01