version 1.43, 2024/03/29 18:42:52 |
version 1.64, 2024/03/30 15:51:42 |
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 ob = {mail: em, sub: su, msg: ms, id: token }; |
|
//var data="", |
|
// status="", |
|
// feed=JSON.stringify(ob); |
|
//$.post("/feedbk/", feed, function(data, status){ |
|
// console.log("Data: " + data + "\nStatus: " + status); |
const dataToSend = JSON.stringify({"email": "hey@mail.com", "password": "101010"}); |
//}); |
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); |
|
|
|
|
|
}, |
}, |