version 1.20, 2024/03/28 18:59:17 |
version 1.27, 2024/03/28 19:22:50 |
Line 13 function validateMsg(msg) { |
|
Line 13 function validateMsg(msg) { |
|
return (msg.length>5); |
return (msg.length>5); |
} |
} |
|
|
|
//async function postData() { |
|
// const formData = new FormData(form); |
|
// try { |
|
// const response = await fetch("/feedbk/", { |
|
// method: "POST", |
|
// body: formData, |
|
// }); |
|
// console.log(await response.json()); |
|
// } catch (e) { |
|
// console.error(e); |
|
// } |
|
//} |
|
|
async function sendData() { |
async function sendData() { |
const form = document.querySelector("#cform"); |
|
const formData = new FormData(form); |
|
var er = 0; |
var er = 0; |
em = document.getElementById("cfem").value, |
em = document.getElementById("cfem").value, |
su = document.getElementById("cfsu").value, |
su = document.getElementById("cfsu").value, |
Line 44 async function sendData() { |
|
Line 55 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}`); |
/* ---------- */ |
// postData(); |
try { |
var data=`${token}|${em}|${su}|${ms}`, |
console.log(`TRY`); |
status=""; |
const response = fetch("https://draft.hgk.global/feedbk/", { |
$.post("/feedbk/", function(data, status){ |
method: "POST", |
console.log("Data: " + data + "\nStatus: " + status); |
body: formData, |
}); |
}); |
|
console.log(`AWAIT`); |
|
console.log(await response.text()); |
|
console.log(`RESPONSE`); |
|
} catch (e) { |
|
console.log(`ERROR`); |
|
console.error(e); |
|
} |
|
} |
|
/* ---------- */ |
|
|
|
}, |
}, |
}); |
}); |
}); |
}); |