- cleanup, interpret /motor/1/123

This commit is contained in:
FrYakaTKoP
2017-10-07 17:26:37 +02:00
parent 6333e98e32
commit 81871b0965
3 changed files with 111 additions and 169 deletions

View File

@@ -24,9 +24,9 @@
console.log(uri);
var xh = new XMLHttpRequest();
xh.onreadystatechange = function(){
if (xh.readyState == 4){
if(xh.status == 200) {
if (this.responseText != null) {
//if (xh.readyState == 4){
//if(xh.status == 200) {
// if (this.responseText != null) {
var res = JSON.parse(xh.responseText);
var ledDiv;
if(initial)
@@ -73,7 +73,7 @@
{
ledElement.checked = false;
}
}
// }
if(initial)
{
@@ -84,8 +84,8 @@
}
}
}
//}
//}
}
};
xh.overrideMimeType("text/json");
@@ -136,7 +136,8 @@
}
}
}
}
console.log("res: " + res);
}
}
};