var xhr = new XMLHttpRequest();
xhr.open('get','xx.xx',false);
xhr.onreadyStateChange = function(){
if(xhr.status == 200 && xhr.readyState == 4) {
console.log('finish');
}
}
xhr.send(null);
console.log('test');
是卡在send之后吗?也就是finish出来之后才出来test
先出来 test 再出来 finish
试试,呵呵,无效不要钱