diff --git a/trigger.html b/trigger.html index fb2f4e9..d2b5a42 100644 --- a/trigger.html +++ b/trigger.html @@ -300,14 +300,13 @@ let delay = ""; let apiKey = ""; const unlockUrl = "https://ths.tnet.space/cgi-bin/unlock-main.cgi"; -// const unlockUrl = "https://ths.tnet.space/cgi-bin/doorcontrol-cgi/test.cgi"; // make fetch function that calls cgi script with attributes (device id, api key, delay) const unlockDoor = (dID, aK, d) => { - //fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`) - fetch(unlockUrl) - .then(response => response.text()) - .then(data => messageContainer.innerHTML = data); + fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`) +// fetch(unlockUrl) + .then(response => response.json()) + .then(data => messageContainer.innerHTML = data.message); } const setSettings = () => {