Refresh today

This commit is contained in:
Niles Rogoff 2017-08-07 08:25:12 -07:00
parent 9493af369e
commit efaaf9fe9e
No known key found for this signature in database
GPG Key ID: B78B908F23430F80
1 changed files with 2 additions and 0 deletions

View File

@ -279,6 +279,7 @@ document.onkeydown = key;
document.onkeyup = keyup;
var ol = function ol() {
document.getElementById("today").innerHTML = ""; // clear before refreshing
request = new XMLHttpRequest();
request.onreadystatechange = function() {
if(request.readyState === 4) {
@ -299,6 +300,7 @@ var ol = function ol() {
}
request.open('GET', 'http://127.0.0.1/today', true);
request.send(null);
setTimeout(ol, 60*1000); // refresh every minute
}
</script></head>""")
master.append("""<body class="" onLoad='ol();'><div id="content">""")