mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
fixed error from braces
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Selecteer alle knoppen en voeg een event listener toe aan elke knop
|
||||
document.querySelectorAll(".btn").forEach(button => {
|
||||
document.querySelectorAll(".btn").forEach((button) => {
|
||||
button.addEventListener("click", function (event) {
|
||||
event.preventDefault(); // voorkomt pagina-verversing
|
||||
|
||||
@@ -9,15 +9,15 @@ document.querySelectorAll(".btn").forEach(button => {
|
||||
fetch("/move", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ direction: direction })
|
||||
body: JSON.stringify({ direction: direction }),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
console.log("Success:", data);
|
||||
})
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
console.error("Error:", error);
|
||||
});
|
||||
});
|
||||
@@ -31,7 +31,7 @@ document.querySelectorAll(".btn").forEach(button => {
|
||||
} catch (error) {
|
||||
console.error("Error:", error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Parse the data and show it on the website
|
||||
async function parseData() {
|
||||
|
Reference in New Issue
Block a user