From 090ca3c2d69d93a4ce29bebc65da1777b42ad384 Mon Sep 17 00:00:00 2001 From: Archie Baer Date: Sat, 15 Jun 2019 22:28:43 +0100 Subject: [PATCH] Working around firefox cors issues --- signup.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/signup.js b/signup.js index 98af735..5006aa8 100644 --- a/signup.js +++ b/signup.js @@ -4,7 +4,7 @@ function signup() { if (sent) return; var email = emailAddr.value; if (!validateEmail(email)) return; - mailbtn.classList.add("fa-clock"); + mailbtn.classList.add("fa-times"); mailbtn.classList.remove("mail-button"); mailbtn.blur(); console.log("Sending request..."); @@ -12,8 +12,10 @@ function signup() { var req = new XMLHttpRequest(); req.onload = function () { console.log(this.status + ": " + this.responseText); - mailbtn.classList.remove("fa-clock"); - mailbtn.classList.add("fa-" + (this.status === 200 ? "check" : "times")); + if (this.status) { + mailbtn.classList.remove("fa-times"); + mailbtn.classList.add("fa-check"); + } }; req.open("POST", "https://whserver.dforms.point0.tech/589550963468140574"); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");