const xhr = new XMLHttpRequest();xhr.responseType = 'json';xhr.onreadystatechange = () => {if(xhr.readyState === 4) {if(xhr.status >= 200 && xhr.status < 300) {console.log('success', xhr.response);}}}// true 是否异步xhr.open('GET', './user.json', true);xhr.send(null);
