From 9bce850002f26806fa31d739d90a24681ffbc4ee Mon Sep 17 00:00:00 2001 From: James Arcus <jimbo@ucc.asn.au> Date: Tue, 17 Sep 2024 21:36:42 +0800 Subject: [PATCH] Fixup door opener latency --- door_open.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/door_open.html b/door_open.html index 7ee6ed6..0c06cd4 100644 --- a/door_open.html +++ b/door_open.html @@ -2,11 +2,20 @@ <html lang="en"> <head> <title>UCC Door Status</title> + <script defer> + fetch('/opener').then(response => { + response.json().then(opener => { + if (opener) { + document.getElementById('opener').innerText = opener; + } + }); + }); + </script> </head> <body> <h1>UCC Door Status</h1> <p>The door is currently open!</p> - <p>Opened by: <span id="opener">a mysterious entity</span></p> + <p>Opened by: <span id="opener"></span></p> <img src="/gary.jpg" width="574" @@ -14,15 +23,6 @@ alt="A wild Gary lurking in the open doorway to the UCC clubroom." title="A wild Gary lurking in the open doorway to the UCC clubroom." ></img> - <script async> - fetch('/opener').then(response => { - response.json().then(opener => { - if (opener) { - document.getElementById('opener').innerText = opener; - } - }); - }); - </script> </body> </html> -- GitLab