-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
35 lines (30 loc) · 1023 Bytes
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
window.addEventListener("load", () => {
async function sendData() {
const XHR = new XMLHttpRequest();
let name=document.getElementById("floatingInputName").value;
let email=document.getElementById("floatingInput").value;
let code=document.getElementById("floatingPassword").value;
console.log(name, email, code);
try {
const data = await fetch("http://localhost:3000/new", {
method: 'POST',
body: JSON.stringify({
name,
email,
code
}),
headers: {
'Content-Type': 'application/json'
},
})
const res = await data.json()
window.location.href = `./camera.html?email=${res.data.Email}`
} catch (err) {
console.log("err: ", err);
}
}
document.getElementById("sbmt").addEventListener("click", helper);
function helper(){
sendData();
};
});