jQuery: Automatically abort AjaxRequests on Page Unload?

后端 未结 5 1603
有刺的猬
有刺的猬 2020-12-06 05:48

Thanks for reading.

I\'ve noticed that if I have a page that has one or more ajax requests open, and I click a link to leave a page, or refresh it, it will wait for

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-06 06:18

    Think you need window.onunload event plus AjaxRequestX = $.get(...) for each request, maybe keep objects in array and go through them on unload.

提交回复
热议问题