version 1.87, 2024/03/31 16:13:39 |
version 1.90, 2024/03/31 16:24:59 |
Line 59 async function sendData() { |
|
Line 59 async function sendData() { |
|
sitekey: '0x4AAAAAAAVpXFEy152AON1L', |
sitekey: '0x4AAAAAAAVpXFEy152AON1L', |
'error-callback': function(e) { |
'error-callback': function(e) { |
info.textContent="Cloudflare Turnstile verification error. Try again later." |
info.textContent="Cloudflare Turnstile verification error. Try again later." |
|
turnstile.remove(); |
}, |
}, |
callback: function(token) { |
callback: function(token) { |
const data = JSON.stringify({"add": mail, "sub": subj, "msg": mess, "tok": token}); |
const data = JSON.stringify({"add": mail, "sub": subj, "msg": mess, "tok": token}); |
info.textContent="Sending..."; |
info.textContent="Sending..."; |
|
fetch("/feedbk/", { |
|
headers: { "Content-Type": "application/json" }, |
|
credentials: "same-origin", |
|
mode: "same-origin", |
|
method: "post", |
|
body: data |
|
}) |
|
.then(response => response.json()) |
|
.then(json => info.textContent=json['msg']) |
|
.then(turnstile.remove();) |
} |
} |
}); |
}); |
}); |
}); |
info.textContent="Fin"; |
|
turnstile.remove(); |
|
}; |
}; |
} |
} |
|
|
// ============================================================= // |
|
/*fetch("/feedbk/", { |
|
credentials: "same-origin", |
|
mode: "same-origin", |
|
method: "post", |
|
headers: { "Content-Type": "application/json" }, |
|
body: dataToSend |
|
}) |
|
.then(response => response.json()) |
|
.then(json => ii.textContent=json['msg']) |
|
|
|
turnstile.close(); |
|
}*/ |
|
|
|
form.addEventListener("submit", (event) => { |
form.addEventListener("submit", (event) => { |
event.preventDefault(); |
event.preventDefault(); |