iching-broker-level2/event.ts
Christopher Hase 3d9fd745cd
Some checks are pending
ci / build (push) Waiting to run
add http-server part 5.8
2025-04-09 15:47:06 +02:00

16 lines
No EOL
473 B
TypeScript

import { executeCommand } from './broker.js';
function handleClick(): void {
console.log("Der Button wurde geklickt!");
alert("Hallo von TypeScript!");
//executeCommand();
fetch("/api/command", { method: "POST" })
.then(res => res.text())
.then(text => console.log("Server sagt:", text));
}
document.addEventListener("DOMContentLoaded", () => {
const button = document.getElementById("myButton");
button?.addEventListener("click", handleClick);
});