version 1.33, 2024/03/28 20:04:56 |
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}`); |
/* --------------------- */ |
|
//var data="", |
|
// status=""; |
|
//$.post("/feedbk/", token, function(data, status){ |
|
// console.log("Data: " + data + "\nStatus: " + status); |
|
//}); |
|
/* --------------------- */ |
const dataToSend = JSON.stringify({"email": "hey@mail.com", "password": "101010"}); |
var response=""; |
fetch("/feedbk/", { |
fetch('/feedbk/', { |
credentials: "same-origin", |
method: 'POST', |
mode: "same-origin", |
headers: { |
method: "post", |
'Accept': 'application/json', |
headers: { "Content-Type": "application/json" }, |
'Content-Type': 'application/json' |
body: dataToSend |
}, |
|
body: JSON.stringify({ "cfem": "a@b.ru", "cfsu" : "subject", "cfme" : "message", "cfto" : "token" }) |
|
}) |
}) |
// .then(response => response.json()) |
.then(response => response.json()) |
// .then(response => console.log(JSON.stringify(response))) |
.then(json => console.log(json)) |
.then(response => response.text()); |
|
console.log(response); |
|
|
|
|
|
|
|
|
|
}, |
}, |