fixing logging

This commit is contained in:
Torsten Ruger
2021-07-03 20:49:43 +03:00
parent 1785f07706
commit 9c6b39fd50
5 changed files with 32 additions and 24 deletions

View File

@ -23,7 +23,6 @@
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
var series = JSON.parse(this.responseText);
var data = { series: series };
chart = new Chartist.Line(clazz, data , {high: 30 , low: -25});
@ -38,19 +37,17 @@
}
var log = document.getElementById("log")
function myCallback() {
function get_log( ){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
log.innerHTML += this.responseText;
}
function get_log( ){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
log.innerHTML = this.responseText + log.innerHTML;
}
xhttp.open("GET", "/log", true);
xhttp.send();
};
}
}
xhttp.open("GET", "/log", true);
xhttp.send();
};
var intervalID = window.setInterval(get_log, 1500);
</script>
<script onload="load_charts();" src="/chartist.min.js.gz"> </script>