我有代码检查网页是否存在完全正常,但我需要检查它是否存在多次。这个代码会缓存,还是每次都会检查?
var url = "urlhere"+"?noCachePlease="+(Math.random()*1000000);
var aa = setInterval(function() {
var request = new XMLHttpRequest();
request.open('GET', url, true);
request.onreadystatechange = function(){
if (request.readyState === 4){
if (request.status === 404) {
//Site DNE
}
else { clearInterval(aa); }
}
};
request.send();
}, 50);
//Afterwards