From d041600ec087b9f36dae5379868f5c51852e26a4 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Mon, 10 Jan 2022 23:50:47 +0100 Subject: [PATCH] Show guest count --- Public/assets/festival-info.js | 14 ++++++++++++++ Public/festival-info.html | 1 + 2 files changed, 15 insertions(+) diff --git a/Public/assets/festival-info.js b/Public/assets/festival-info.js index 4a8a7fa..2729246 100644 --- a/Public/assets/festival-info.js +++ b/Public/assets/festival-info.js @@ -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); +} diff --git a/Public/festival-info.html b/Public/festival-info.html index ce14c1e..edc7a94 100644 --- a/Public/festival-info.html +++ b/Public/festival-info.html @@ -49,6 +49,7 @@
Liste nicht geladen
+