JS-Web-API(三):Ajax

// 初始化实例 const xhr = new XMLHttpRequest() // 第三个参数true则为异步 xhr.open('GET','url', true) xhr.onreadystatechange = function () { // 这里函数异步执行 if (xhr.readyState === 4) { if (xhr.statusCode === 200) { console.log(xhr.responseText) } else { ...