如何根据状态变化暂停ajax?任何帮助将不胜感激!
var myRequest = new XMLHttpRequest();
myRequest.onreadystatechange = function(){
var state = myRequest.readyState,
//if state === 2 wait for 5 secs and then continue???
}
myRequest.open("GET", "forAjax.html", true);
myRequest.send();