JSFiddle - React, Tailwind, and code Playground
by kukaew
JavaScript
cursArr();
function cursArr() {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'A.json', false);
xhr.send();
console.log(xhr.status);
console.log(xhr.responseText);
if (xhr.status != 200) {
xhr.open('GET', 'B.json', false);
xhr.send();
return JSON.parse(xhr.responseText);
}
else {
return JSON.parse(xhr.responseText);
}
}