diff --git a/door_open.html b/door_open.html index 7ee6ed64345975e07d1af1f6c933a1b45f3d496d..0c06cd48333839f4ac056c34cc6ed2ac7ee1f3b4 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>