ajax - 浏览器中的 Ajax 请求句柄以及如何在完成后从网络选项卡中删除 ajax 请求
问题描述
在浏览器网络选项卡中可以处理多少 ajax 请求?如果我发送 100k ajax 请求,浏览器网络选项卡是否可以发送 100k ajax 请求,或者我可以在完成后从网络选项卡中清除我之前的 ajax 请求?
解决方案
尝试这个..
$.ajax({
type:"POST",
url: form.attr('action'),
data:form.serialize(),
dataType: "json",
success: function(response){
if(response.msgtype=="success"|| response.msgtype=="fail") {
clearconsole(); // this will clear out the console
}
});
或者在 Firefox 中
if (! ('console' in window) || !('firebug' in console)) {
var names = ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'];
window.console = {};
for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};
}
推荐阅读
- javascript - React + Apollo + 缓存 + refetchQueries ;缓存更新在突变后被覆盖
- python - 如何循环将新列添加到具有值的熊猫数据框基于其他列值
- python - Swagger / OpenAPI 规范以文件上传为特色,被 Google Endpoints 拒绝
- node.js - 如何从本地主机向我的 docker 容器发送 HTTP 请求?
- google-cloud-platform - 无法为主题创建订阅
- architecture - 虚拟内存功能
- reactjs - Apollo GraphQL 的动态标头(中间件之外)
- performance - 调度不同缓存名称的性能和影响
- esp8266 - 如何知道 ESP8266 上的 spiffs 分区中剩余多少空间?
- dart - List.map 是否保证保留原始列表的排序顺序?