samedi 13 août 2016

ajax to location.replace(ajax.responseText) reloads forever

I can't figure out why this is happening, and there is no documentation of it:

<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<h1>HideSite</h1>
<p id="p"></p>
<script>
var ajax;
if (window.XMLHttpRequest) {
    ajax = new XMLHttpRequest();
} else {
    ajax = new ActiveXObject("Microsoft.XMLHTTP");
}

ajax.onreadystatechange = function() {
    location.replace(ajax.responseText);
}
if (navigator.userAgent == 'code') {
    ajax.open("POST", "location.txt", true);
    ajax.send();
}
</script>
</body>
</html>

location.txt contains the location of a file.




Aucun commentaire:

Enregistrer un commentaire