version 1.39, 2024/03/28 20:27:38 |
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="", |
|
feed=JSON.stringify({ "cfem": "${em}", "cfsu" : "${su}", "cfme" : "${me}", "cfto" : "${token}" }); |
|
$.post("/feedbk/", feed, function(data, status){ |
|
console.log("Data: " + data + "\nStatus: " + status); |
fetch("/feedbk/", { |
}); |
credentials: "same-origin", |
/* --------------------- */ |
mode: "same-origin", |
//var re=""; |
method: "post", |
//re=fetch('/feedbk/', { |
headers: { "Content-Type": "application/json" }, |
// method: 'POST', |
body: dataToSend |
// headers: { |
}) |
// 'Accept': 'application/json', |
.then(response => response.json()) |
// 'Content-Type': 'application/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); |
|
|
|
|
|
}, |
}, |