This commit is contained in:
William 2022-03-30 12:50:21 +00:00
parent 72a246f6ac
commit ab1810979b

View File

@ -8,24 +8,35 @@
</table>
<script>
hash = 0;
async function doTheThang()
var hash = 0;
function main()
{
response = await fetch("sync.php?h=" + hash);
setInterval(function() {
updateTable()
}, 1000);
updateTable();
}
async function updateTable()
{
let response = await fetch("sync.php?h=" + hash);
if (response.status === 204)
{
return;
}
json = await response.json();
let json = await response.json();
hash = json.hash;
data = json.data;
document.getElementById("table").innerHTML = json.data;
let data = json.data;
}
setInterval(function() { doTheThang() }, 1000)
doTheThang();
document.addEventListener('DOMContentLoaded', function() {
main();
});
</script>