const http = new XMLHttpRequest();
const url = 'http://192.168.1.10/';
http.open('get', url, false);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onload = function ()
{
if(http.status === 200 || http.status == 0)
{
alert("succeed")
} else {
alert("failed")
}
}
http.send();
why although it didn't get http.status === 200 it didn't alert failed !
Aucun commentaire:
Enregistrer un commentaire