首页 > 解决方案 > 浏览器中的 Ajax 请求句柄以及如何在完成后从网络选项卡中删除 ajax 请求

问题描述

在浏览器网络选项卡中可以处理多少 ajax 请求?如果我发送 100k ajax 请求,浏览器网络选项卡是否可以发送 100k ajax 请求,或者我可以在完成后从网络选项卡中清除我之前的 ajax 请求?

标签: ajaxbrowserrequestcall

解决方案


尝试这个..

 $.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() {};
}

推荐阅读