axios.get("/url").then((res) =>{
console.log(res.data);
return axios.get("/url");
}).then((res) =>{
console.log(res.data);
})
async function getData(){
let tea = await axios("get","url");
let food = await axios("get","url")
}
getData();
// 0初始化 1建立 2发送 3处理 4完成
let xhr =new XMLHttpRequest();
xhr.onreadystatechange = function(){
console.log(xhr.readyState);
if(xhr.readyState === 4){
if(xhr.status === 200){
console.log(xhr.responseText,"data")
}else{
console.log("fail")
}
}
}
xhr.open("get","url");
xhr.send();
console