fixing the redirect again
This commit is contained in:
parent
cba16088c5
commit
db2209b7d1
|
@ -52,16 +52,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.onreadystatechange = (e) => {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState !== 4) {
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
return;
|
window.location.href = '/thankyou/';
|
||||||
}
|
|
||||||
|
|
||||||
if (xhr.status === 200) {
|
|
||||||
console.log('SUCCESS', xhr.responseText);
|
|
||||||
window.location.href = "/thankyou/";
|
|
||||||
} else {
|
|
||||||
console.warn('request_error', xhr.responseText);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhr.open("POST", "https://n8n.tfcconnection.org/webhook/health-form");
|
xhr.open("POST", "https://n8n.tfcconnection.org/webhook/health-form");
|
||||||
|
|
Loading…
Reference in a new issue