Compare commits
3 Commits
c39968865c
...
f34980e28f
| Author | SHA1 | Date | |
|---|---|---|---|
| f34980e28f | |||
|
|
e5e23caab8 | ||
|
|
21bb6add65 |
@@ -70,22 +70,28 @@
|
||||
|
||||
<script>
|
||||
document.getElementById("person").addEventListener("change", (event) => {
|
||||
const options = {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ person: event.target.value }),
|
||||
};
|
||||
if (
|
||||
window.confirm(
|
||||
`Vérification! Tu es ${event.target.value}, c'est bien ça?`
|
||||
)
|
||||
) {
|
||||
const options = {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ person: event.target.value }),
|
||||
};
|
||||
|
||||
console.log(options);
|
||||
console.log(options);
|
||||
|
||||
fetch("api", options)
|
||||
.then((response) => response.text())
|
||||
.then((text) => {
|
||||
document.getElementById(
|
||||
"result"
|
||||
).textContent = `Hoho! Tu as pioché ${text} ;`;
|
||||
document.getElementById("person").remove();
|
||||
});
|
||||
fetch("api", options)
|
||||
.then((response) => response.text())
|
||||
.then((text) => {
|
||||
document.getElementById(
|
||||
"result"
|
||||
).textContent = `Hoho! Tu as pioché ${text} ;`;
|
||||
document.getElementById("person").remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user