0
following code:
let info = new Array()
info[0] = 'index.php'
info[1] = 'portifolio.php'
info[2] = 'nn'
let url = ['https://xraros.000webhostapp.com/']
let proxy = 'https://cors-anywhere.herokuapp.com/';
let ajax = new XMLHttpRequest();
for(let i = 0; i < info.length; i++){
ajax.onreadystatechange = () => {
if(ajax.readyState == 4){
if(ajax.status == 200){
console.log('achou')
}else{
console.log('nao achou')
}
}
}
ajax.open('GET',proxy+url+info[i],true);
ajax.send()
}
I want to know why the other answers do not appear on the console and only one that is:
GET https://cors-anywhere.herokuapp.com/https://xraros.000webhostapp.com/nn 404 (Not Found)
(anonymous) @ teste.html:40
teste.html:32 nao achou
have to test the index values of the array and show for each one if found or did not find? It’s been a long time since I’ve had this doubt..., I’ve just tried it like the code above. Thank you very much.
Thank you very much! I help very much! =)
– Teuzero