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
2022-03-30 12:50:21 +00:00

42 lines
588 B
PHP

<h1>Live resultater</h1>
<br>
<table id ="table">
<tr>
<th>Some shit</th>
<th>Some shit</th>
</tr>
</table>
<script>
var hash = 0;
function main()
{
setInterval(function() {
updateTable()
}, 1000);
updateTable();
}
async function updateTable()
{
let response = await fetch("sync.php?h=" + hash);
if (response.status === 204)
{
return;
}
let json = await response.json();
hash = json.hash;
let data = json.data;
}
document.addEventListener('DOMContentLoaded', function() {
main();
});
</script>