var xhrCount = 0;
// AJAX
var xhr = new XMLHttpRequest();
xhrCount += 1;
...
xhr.onreadystatechange = function () {
...
if (xhr.readyState === 4)
xhrCount -= 1;
};
// Check if all AJAX requests done
if (xhrCount > 0)
console.log('Another AJAX request is processing...');