version 1.36, 2024/03/28 20:13:40 |
version 1.65, 2024/03/30 16:16:46 |
Line 44 async function sendData() { |
|
Line 44 async function sendData() { |
|
callback: function(token) { |
callback: function(token) { |
ii.textContent="Sent"; |
ii.textContent="Sent"; |
console.log(`Challenge Success ${token}`); |
console.log(`Challenge Success ${token}`); |
/* --------------------- */ |
const dataToSend = JSON.stringify({"add": em, "sub": su, "msg": ms, "tok": token}); |
//var data="", |
console.log(`JSON: ${dataToSend}`); |
// status=""; |
|
//$.post("/feedbk/", token, function(data, status){ |
|
// console.log("Data: " + data + "\nStatus: " + status); |
|
//}); |
fetch("/feedbk/", { |
/* --------------------- */ |
credentials: "same-origin", |
var re=""; |
mode: "same-origin", |
re=fetch('/feedbk/', { |
method: "post", |
method: 'POST', |
headers: { "Content-Type": "application/json" }, |
headers: { |
body: dataToSend |
'Accept': 'application/json', |
}) |
'Content-Type': 'application/json' |
.then(response => response.json()) |
}, |
.then(json => console.log(json)) |
body: JSON.stringify({ "cfem": "a@b.ru", "cfsu" : "subject", "cfme" : "message", "cfto" : "token" }) |
|
}); |
|
// .then(response => response.json()) |
|
// .then(response => console.log(JSON.stringify(response))) |
|
console.log(re.text()); |
|
|
|
|
|
}, |
}, |