diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 28e622a52..1900a3824 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -247,6 +247,8 @@ function createHTTPClient() { function onAjaxRequestStateChange(http) { try { if (http.readyState == 4) { + activeAjaxRequests--; + checkAjaxRequestsState(); if (http.status == 0 && usesCASAuthentication) { recoveryRequest = http; var urlstr = ApplicationBaseURL; @@ -258,8 +260,6 @@ function onAjaxRequestStateChange(http) { else if (activeAjaxRequests > 0) { if (!http.aborted) http.callback(http); - activeAjaxRequests--; - checkAjaxRequestsState(); http.onreadystatechange = Prototype.emptyFunction; http.callback = Prototype.emptyFunction; http.callbackData = null;