13 lines
431 B
TypeScript
13 lines
431 B
TypeScript
function handleClick(): void {
|
|
console.log("Der Button wurde geklickt!");
|
|
|
|
fetch("/iching/api/command", { method: "POST" })
|
|
.then(res => res.text())
|
|
.then(text => console.log("Server sagt:", text))
|
|
.catch(error => console.error("Fehler:", error));
|
|
}
|
|
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
const button = document.getElementById("myButton");
|
|
button?.addEventListener("click", handleClick);
|
|
});
|