Files
esp8266_deauther/htmlfiles/functions.js
Stefan Kremser b2907561c3 Fixed beacon attack
works now, but unfornatly only in broadcast. An targeted beacon flood attack on a specific client  is mostly dropped (maybe because of the SDK?).
2017-02-24 18:24:44 +01:00

13 lines
471 B
JavaScript

function getResponse(adr, callback, timeoutCallback = function(){alert("timeout error. Please reload the site");}, timeout = 5000){
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4){
if(xmlhttp.status == 200) callback(xmlhttp.responseText);
else timeoutCallback();
}
};
xmlhttp.open("GET", adr, true);
xmlhttp.send();
xmlhttp.timeout = timeout;
xmlhttp.ontimeout = timeoutCallback;
}