2023-12-30 14:33:52 -07:00
|
|
|
<!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>
|
2023-12-30 14:37:36 -07:00
|
|
|
<!-- 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 -->
|
2023-12-30 14:33:52 -07:00
|
|
|
<div hx-ext="ws" ws-connect="/ws">
|
2023-12-30 14:37:36 -07:00
|
|
|
<div id="messages"></div>
|
2023-12-30 14:33:52 -07:00
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|