【XMLHttpRequest】

const xhr = new XMLHttpRequest();
xhr.open("POST", "/menu/list/111", false);
xhr.onload = function (){
if (xhr.readyState === 4 && xhr.status === 200) {
//xhr.response为请求到的数据
console.log('xhr.response:',xhr.response);
let result = JSON.parse(xhr.response);
}
}
xhr.send();

posted @ 2022-10-27 23:45  小猫会发光  阅读(31)  评论(0)    收藏  举报