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
You have to persist all you ajax request and when page is being reloading abort all requests. Sample
var _requests = [];
var _abortAllRequests = function () {
$(_requests).each(function (i, xhr) { xhr.abort(); });
_requests = [];
}
$(window).on("beforeunload", function () {
_abortAllRequests();
});
somewhere in your code
_requests.push($.ajax(...))
Additionally you can pop done requests using $.ajaxSetup with events ajaxStart ajaxStop, but its up to you