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.
我的页面上有一个计时器,它每分钟刷新一次。此页面还有搜索功能。现在假设在页面刷新前只剩下 5 秒时,搜索功能需要 10 秒才能运行 - 无论如何它最终都会刷新并且搜索结果会丢失。
我想知道是否有一种方法可以通用地连接到传出的网络请求并取消我的刷新计时器。我知道对于AJAX方法,您可以设置一个全局事件处理程序,有没有办法为这样的普通表单提交执行此操作,但更通用的是 - 不必手动挂钩每个表单?