mysterious-toddler-20573
01/18/2022, 3:03 AMbrave-magazine-28098
01/18/2022, 4:56 AMhx-preserve but only preserve the element it is on and not its children? I am trying to preserve the state of an alpine compenent's x-data. I can work around it by moving the state up a level from the element that gets swapped but it would help keep the state within the template partial and improve the LoB :).orange-coat-6565
01/18/2022, 5:38 AMorange-coat-6565
01/18/2022, 5:39 AMbrave-magazine-28098
01/18/2022, 5:49 AMorange-coat-6565
01/18/2022, 5:50 AMorange-coat-6565
01/18/2022, 5:50 AMorange-coat-6565
01/18/2022, 5:51 AMorange-coat-6565
01/18/2022, 5:52 AMbrave-magazine-28098
01/18/2022, 5:59 AM<!-- htmx_demo.html -->
<!-- Load from unpkg -->
<script src="https://unpkg.com/htmx.org@1.6.1"></script>
<!-- have a button POST a click via AJAX -->
<button hx-get="/htmx_button.html" hx-swap="outerHTML">
Click Me
</button>
<!-- htmx_button.html -->
<button>
New Button
</button>
Then run a quick webserver with python -m http.server 8888
Then go to http://localhost:8888/htmx_demo.html and everything should workgorgeous-ghost-95789
01/18/2022, 6:11 AMorange-coat-6565
01/18/2022, 6:12 AMorange-coat-6565
01/18/2022, 6:16 AMorange-coat-6565
01/18/2022, 6:18 AMorange-coat-6565
01/18/2022, 6:19 AMgorgeous-ghost-95789
01/18/2022, 6:19 AMgorgeous-ghost-95789
01/18/2022, 6:20 AMhx-get=“https://google.com”gorgeous-ghost-95789
01/18/2022, 6:20 AMgorgeous-ghost-95789
01/18/2022, 6:22 AMgorgeous-ghost-95789
01/18/2022, 6:23 AMorange-coat-6565
01/18/2022, 6:23 AMgorgeous-ghost-95789
01/18/2022, 6:23 AMorange-coat-6565
01/18/2022, 6:24 AMorange-coat-6565
01/18/2022, 6:24 AMgorgeous-ghost-95789
01/18/2022, 6:24 AMorange-coat-6565
01/18/2022, 6:24 AMgorgeous-ghost-95789
01/18/2022, 6:25 AMgorgeous-ghost-95789
01/18/2022, 6:25 AMorange-coat-6565
01/18/2022, 6:27 AM