now with dynamic counter too

This commit is contained in:
2025-01-10 18:09:32 -05:00
parent a745239d16
commit 987baf1ad6
8 changed files with 103 additions and 5 deletions

11
htmx/count.html Normal file
View File

@@ -0,0 +1,11 @@
<!doctype html>
<html>
<head>
<title>htmx test</title>
<script src="htmx.min.js"></script>
</head>
<body>
<button id="nextbtn" hx-get="http://127.0.0.1:9000/next" hx-swap="innerHTML" hx-target="#counter">Get Next</button>
<p>Count: <span id="counter" hx-trigger="load" hx-get="http://127.0.0.1:9000/next"></span> </p>
</body>
</html>

View File

@@ -5,7 +5,7 @@
<script src="htmx.min.js"></script>
</head>
<body>
<button hx-get="/foreign/html/card.html" hx-swap="beforeend" hx-target="#target">Load Card</button>
<button id="nextbtn" hx-get="/foreign/html/card.html" hx-swap="beforeend" hx-target="#target">Load Card</button>
<div id="target" hx-trigger="load" hx-get="/foreign/html/card.html">
</div>
</body>