Working around firefox cors issues

This commit is contained in:
Archie Baer 2019-06-15 22:28:43 +01:00
parent 904b82f32b
commit 090ca3c2d6
1 changed files with 5 additions and 3 deletions

View File

@ -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");