mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 15:11:35 +01:00
implement liveupdates player count via set interval
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
<div class="container mt-3 mb-3" role="main">
|
<div class="container mt-3 mb-3" role="main">
|
||||||
<div id="playerDisplay" class="playerDisplay mb-3 mt-2">
|
<div id="playerDisplay" class="playerDisplay mb-3 mt-2">
|
||||||
<script>
|
<script>
|
||||||
|
function players(){
|
||||||
fetch("/players-online").then(
|
fetch("/players-online").then(
|
||||||
response => response.json()
|
response => response.json()
|
||||||
).then(
|
).then(
|
||||||
@@ -23,6 +24,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
players()
|
||||||
|
setInterval(players, 2000)
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<table id="tableMain" class="table table-striped table-bordered table-sm"
|
<table id="tableMain" class="table table-striped table-bordered table-sm"
|
||||||
|
|||||||
Reference in New Issue
Block a user