Show guest count

This commit is contained in:
Christoph Hagen 2022-01-10 23:50:47 +01:00
parent 4622ad8d59
commit d041600ec0
2 changed files with 15 additions and 0 deletions

View File

@ -17,3 +17,17 @@ function loadList(name, source) {
txtFile.open("GET", list, true);
txtFile.send(null);
}
function loadCount() {
var txtFile = new XMLHttpRequest();
var allText = "";
txtFile.onreadystatechange = function () {
if (txtFile.readyState === XMLHttpRequest.DONE && txtFile.status == 200) {
allText = txtFile.responseText;
}
document.getElementById("left-button").innerHTML = "Registered (" + allText + ")";
}
var list = '/festival/api/count' + name;
txtFile.open("GET", list, true);
txtFile.send(null);
}

View File

@ -49,6 +49,7 @@
</div>
<div class="member-list" id="remote-content">Liste nicht geladen</div>
<script>loadList('registered.txt', document.getElementById('left-button'))</script>
<script>loadCount()</script>
</div>
</body>
</html>