var isRequestProcessed = false; ... if (!isRequestProcessed) { isRequestProcessed = true; request = new window.XMLHttpRequest(); //.. request.onreadystatechange = function () { //.. isRequestProcessed = false; } }