Javascript compatibility with old browser. Thanks to @benjenq

This commit is contained in:
N0vaPixel
2017-03-08 01:43:09 +01:00
parent cdf71764bf
commit dcdec41066
3 changed files with 17 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@@ -75,7 +75,10 @@
}
}
function getResults(reload = false){
function getResults(reload){
if(reload === undefined){
reload = false;
}
getResponse("ClientScanResults.json",function(responseText){
res = JSON.parse(responseText);
res.clients = res.clients.sort(compare);

View File

@@ -1,4 +1,12 @@
function getResponse(adr, callback, timeoutCallback = function(){location.reload()}, timeout = 8000){
function getResponse(adr, callback, timeoutCallback, timeout){
if(timeoutCallback === undefined) {
timeoutCallback = function(){
location.reload()
};
}
if(timeout === undefined) {
timeout = 8000;
}
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4){