=================================================================== RCS file: /cvs/cvs/draft/form.min.js,v retrieving revision 1.87 retrieving revision 1.89 diff -u -p -r1.87 -r1.89 --- draft/form.min.js 2024/03/31 16:13:39 1.87 +++ draft/form.min.js 2024/03/31 16:22:00 1.89 @@ -63,27 +63,21 @@ async function sendData() { callback: function(token) { const data = JSON.stringify({"add": mail, "sub": subj, "msg": mess, "tok": token}); 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']) } }); }); - 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) => { event.preventDefault();