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

42 lines
588 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 12:50:21 +00:00
var hash = 0;
function main()
{
setInterval(function() {
updateTable()
}, 1000);
updateTable();
}
async function updateTable()
2022-03-23 13:03:33 +00:00
{
2022-03-30 12:50:21 +00:00
let response = await fetch("sync.php?h=" + hash);
2022-03-30 08:51:46 +00:00
if (response.status === 204)
{
return;
}
2022-03-30 12:50:21 +00:00
let json = await response.json();
2022-03-30 08:51:46 +00:00
hash = json.hash;
2022-03-30 12:50:21 +00:00
let data = json.data;
2022-03-30 08:51:46 +00:00
}
2022-03-30 12:50:21 +00:00
document.addEventListener('DOMContentLoaded', function() {
main();
});
2022-03-21 11:28:18 +00:00
</script>