This commit is contained in:
@@ -149,14 +149,13 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub
|
||||
button.disabled = true;
|
||||
button.textContent = STRINGS.sending || "Sending…";
|
||||
try {
|
||||
const res = await fetch(form.dataset.webhook, {
|
||||
await fetch(form.dataset.webhook, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
mode: "no-cors", // tell the browser we don't need to read the response
|
||||
headers: { "Content-Type": "text/plain;charset=UTF-8" }, // no preflight triggered
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
if (!res.ok) throw new Error("HTTP " + res.status);
|
||||
form.innerHTML =
|
||||
'<p class="lead-ok"></p>';
|
||||
form.innerHTML = '<p class="lead-ok"></p>';
|
||||
form.querySelector(".lead-ok").textContent = form.dataset.i18nSuccess;
|
||||
} catch {
|
||||
const p = document.createElement("p");
|
||||
|
||||
Reference in New Issue
Block a user