【问题标题】:Ajax Request handle at time in browser and how to remove ajax request after its complete from network tab浏览器中的 Ajax 请求句柄以及如何在完成后从网络选项卡中删除 ajax 请求
【发布时间】:2020-04-05 03:45:47
【问题描述】:

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

【问题讨论】:

    标签: ajax browser request call


    【解决方案1】:

    试试这个..

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

    【讨论】:

      猜你喜欢
      • 2011-08-18
      • 2017-12-09
      • 1970-01-01
      • 2020-10-10
      • 1970-01-01
      • 1970-01-01
      • 2012-05-10
      • 2012-04-14
      • 2021-12-03
      相关资源
      最近更新 更多