weixin_33690367 2015-08-30 08:50 采纳率: 0%
浏览 10

在VanillaJS中搁置ajax

How to put ajax on hold based on the state change? Any help will be appreciated!

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();
  • 写回答

0条回答 默认 最新

    报告相同问题?