Commit
This commit is contained in:
parent
72a246f6ac
commit
ab1810979b
@ -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>
|
Reference in New Issue
Block a user