mysterious-toddler-20573
12/29/2020, 10:59 PMhx-push-url
https://htmx.org/attributes/hx-push-url/mysterious-toddler-20573
12/29/2020, 10:59 PMmysterious-toddler-20573
12/29/2020, 11:00 PMhx-boost
the better SEO you should get, in generalhelpful-secretary-3515
12/29/2020, 11:38 PMgorgeous-ghost-95789
12/30/2020, 12:20 AMHX-Request
header on product pages — you’ll need to return all of your regular page headers and footers, along with the contents of the page underneath the modal pop up. Then, update the URL (or something similar) when visitors dismiss the modal pop up. This will be really great to see, when it’s live!salmon-xylophone-28580
12/30/2020, 7:42 AMhx-swap
is innerHTML. Maybe it is just me, but I use outerHTML more often than innerHTML. I don't want to change the default (since I think this is too late now). What value of hx-swap do you use the most?mysterious-toddler-20573
12/30/2020, 3:31 PMinnerHTML
a bit more, and it's been the default forever. The good news is that you can configure the default to your liking:
https://htmx.org/docs/#configmysterious-toddler-20573
12/30/2020, 3:31 PMhtml
<meta name="htmx-config" content='{"defaultSwapStyle":"outerHTML"}'>
adamant-exabyte-92636
01/01/2021, 12:32 PMmysterious-toddler-20573
01/01/2021, 2:38 PMbig-airline-13935
01/01/2021, 2:49 PMmost-jelly-15242
01/01/2021, 3:28 PMadamant-exabyte-92636
01/01/2021, 5:19 PMadamant-exabyte-92636
01/01/2021, 5:28 PM<meta name="htmx-config" content='{"defaultSwapStyle":"outerHTML"}'>
. What do you think?gorgeous-ghost-95789
01/01/2021, 5:56 PM<body hx-ext="preload" preload="on:mouseover wait:100ms">
then all of the elements below (marked with a preload
attribtute) will use these settings instead of the default values.adamant-exabyte-92636
01/01/2021, 5:58 PMgorgeous-ghost-95789
01/01/2021, 5:58 PMpreload="on:mouseover wait:100ms"
gorgeous-ghost-95789
01/01/2021, 5:58 PMadamant-exabyte-92636
01/01/2021, 6:00 PMgorgeous-ghost-95789
01/01/2021, 6:02 PMmysterious-toddler-20573
01/01/2021, 9:59 PMmysterious-toddler-20573
01/02/2021, 2:51 AMhtml
...
<div id="tab1" hx-get="/whatever" hx-trigger="click, keyup[ctrlKey&&textContent=='C'] from:body">Tab 1</div>
...
gorgeous-ghost-95789
01/02/2021, 3:00 AMgorgeous-ghost-95789
01/02/2021, 3:00 AMgorgeous-ghost-95789
01/02/2021, 3:04 AMhx-sse
works. But on further thought, instead of saying preload=“on:mousedown wait:100ms”
it seems like it would be better to use two separate attributes, like preload-on=“mousedown” preload-wait=“100ms”
. It’s more like standard HTML, and will actually take less code to accomplish. How do you feel about this as a general pattern @mysterious-toddler-20573?mysterious-toddler-20573
01/02/2021, 3:14 AMgorgeous-ghost-95789
01/02/2021, 3:14 AMgorgeous-ghost-95789
01/02/2021, 3:16 AMgorgeous-ghost-95789
01/02/2021, 4:32 AMsalmon-xylophone-28580
01/02/2021, 1:18 PM