iching-broker-level2/frontend/event.ts
Christopher Hase 165b39ded7
Some checks are pending
ci / build (push) Waiting to run
add http-server part 8.3.4
2025-04-14 11:58:03 +02:00

14 lines
467 B
TypeScript

function handleClick(): void {
console.log("Der Button wurde geklickt!");
//alert("Hallo von TypeScript!");
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);
});