version 1.87, 2024/03/31 16:13:39 |
version 1.88, 2024/03/31 16:20:10 |
Line 63 async function sendData() { |
|
Line 63 async function sendData() { |
|
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']) |
} |
} |
}); |
}); |
}); |
}); |
info.textContent="Fin"; |
|
turnstile.remove(); |
turnstile.remove(); |
|
turnstile.close(); |
}; |
}; |
} |
} |
|
|
// ============================================================= // |
|
/*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(); |