htmxmqtt/site/index.html

21 lines
741 B
HTML

<!DOCTYPE <!DOCTYPE html>
<html lang="en">
<head>
<title>HTMX MQTT Test Page</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="style.css" rel="stylesheet">
<script src="https://unpkg.com/htmx.org"></script>
<script src="https://unpkg.com/htmx.org/dist/ext/ws.js"></script>
</head>
<body>
<h1>Test Page</h1>
<!-- Use "<p id=\"messages\">test_0</br></p>" as the websocket message to replace the "messages" div -->
<!-- Alternatively do "<p hx-swap-oob=\"beforeend:#messages\">test_0</br></p>" to add it to the end of the messages div -->
<div hx-ext="ws" ws-connect="/ws">
<div id="messages"></div>
</div>
</body>
</html>