I'm building a chrome extension and my Ajax request's response comes off as "ready" (Status 200 and readystate 4) 4 times instead of just once , and it doesn't go through stages 1-3 . Instead 4 times 4 . This is bad for me since I'm alerting something to the user 4 times instead of once . My code is simple javascript \[code\]var xmlhttp = new XMLHttpRequest();xmlhttp.onreadystatechange = function() { console.log(xmlhttp.readyState + xmlhttp.status); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { if (xmlhttp.response) checkForAlertTab(xmlhttp.response); else console.log('false'); }}xmlhttp.open("POST", "http://myserver.php", true);xmlhttp.setRequestHeader("Content-Type", "application/json");xmlhttp.send(sendToServer);\[/code\]My code in the server is just a php that pulls some data from a database and echos it back out , the response is nice and dandy (the information is there) but why isn't the ajax readystate going through his stages normally - what can be the cause of this ?