【发布时间】:2020-04-05 03:45:47
【问题描述】:
在浏览器网络选项卡中可以处理多少 ajax 请求?如果我发送 100k ajax 请求,浏览器网络选项卡是否可以发送 100k 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() {};
}
【讨论】: