简体   繁体   English

检查是否存在任何AJAX请求

[英]Check if there are any AJAX request alive

I do a lot of AJAX Requests at the same time. 我同时执行许多AJAX请求。 I need to know when EVERY requests are over. 我需要知道每一个请求何时结束。 How do I check that? 我该如何检查? Thank you! 谢谢!

Increment a counter with every request you issue, decrement that counter and test for zero when you get the response. 在您发出的每个请求中增加一个计数器,减少该计数器并在收到响应时测试为零。

Remember that most browsers limit the number of concurrent requests that can be issued against the same server, queueing them up. 请记住,大多数浏览器都会限制可以针对同一服务器发出的并发请求的数量,从而将它们排队。 It might benefit performance if you could combine some of the requests. 如果您可以合并一些请求,则可能会提高性能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM