Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在发送一个在选择框的更改事件上调用的 ajax 请求。现在我想要的是,当一个新请求发送到服务器时,它将中止所有以前的 ajax 请求,否则会有很多 ajax 请求同时执行。我只想执行最新的请求。
所有的帮助都将是非常可观的。
使用 jQuery 中止 Ajax 请求
只需将 XMLHttpRequests 存储在一个数组中并一一中止它们。