I
Size: a a a
I
S
I
I
const getXhrData = (url) => {
let data;
const xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
if (xhr.status !== 200) {
console.log(xhr.status);
} else {
data = JSON.parse(xhr.response);
}
}
};
xhr.send();
return data;
}
S
ES
I
S
I
S
A
const getXhrData = (url) => {
let data;
const xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
if (xhr.status !== 200) {
console.log(xhr.status);
} else {
data = JSON.parse(xhr.response);
}
}
};
xhr.send();
return data;
}
A
I
S
S
A
ГЩ
const getXhrData = (url) => {
let data;
const xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
if (xhr.status !== 200) {
console.log(xhr.status);
} else {
data = JSON.parse(xhr.response);
}
}
};
xhr.send();
return data;
}
setTimeout( () => return data, 1000)
I
setTimeout( () => return data, 1000)
ГЩ