This repository has been archived on 2023-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
web/app/view/pages/race/live-results.php

31 lines
511 B
PHP
Raw Normal View History

2022-03-21 11:28:18 +00:00
<h1>Live resultater</h1>
2022-03-23 13:03:33 +00:00
<br>
2022-03-30 08:51:46 +00:00
<table id ="table">
2022-03-23 13:03:33 +00:00
<tr>
<th>Some shit</th>
<th>Some shit</th>
</tr>
</table>
2022-03-21 11:28:18 +00:00
2022-03-23 09:08:36 +00:00
<script>
2022-03-30 08:51:46 +00:00
hash = 0;
async function doTheThang()
2022-03-23 13:03:33 +00:00
{
2022-03-30 08:51:46 +00:00
response = await fetch("sync.php?hash=" + hash);
if (response.status === 204)
{
return;
}
json = await response.json();
hash = json.hash;
data = json.data;
document.getElementById("table").innerHTML = json.data;
}
setInterval(function() { doTheThang() }, 1000)
doTheThang();
2022-03-21 11:28:18 +00:00
</script>