mysterious-toddler-20573
12/27/2020, 2:57 PMhtml
<div onclick="htmx.trigger('#otherDiv', 'makeRequest') >...</div>
<div id="otherDiv" hx-trigger="makeRequest" hx-get="/whatever">...</div>
mysterious-toddler-20573
12/27/2020, 2:59 PMadamant-exabyte-92636
12/27/2020, 3:01 PMadamant-exabyte-92636
12/27/2020, 4:34 PMon <event> trigger <another-event> on #an-element
example in the hyperscript docs? Is it an undocumented feature that you can trigger events on other elements? Reading the trigger https://hyperscript.org/commands/trigger/ documentation makes it seems like trigger is only for the current element? The send
command (https://hyperscript.org/commands/send/) seems more appropriate for triggering events on other elements? But this begs the question... if you can use trigger
to send events on other elements, what's the point of having both trigger
and send
?mysterious-toddler-20573
12/27/2020, 4:53 PMgorgeous-ghost-95789
12/27/2020, 5:20 PMgorgeous-ghost-95789
12/27/2020, 5:21 PMadamant-exabyte-92636
12/27/2020, 5:30 PMgorgeous-ghost-95789
12/27/2020, 6:20 PMadamant-exabyte-92636
12/27/2020, 8:29 PMgorgeous-ghost-95789
12/27/2020, 8:33 PMsalmon-xylophone-28580
12/28/2020, 8:49 AMmillions-apartment-38225
12/28/2020, 9:09 AMsalmon-xylophone-28580
12/28/2020, 4:23 PMhtmx-request-target
class on the hx-target element would be great. I created a feature request: https://github.com/bigskysoftware/htmx/issues/290
What do you think?gorgeous-ghost-95789
12/28/2020, 4:54 PMWHILE
is a fantastic, brilliant idea for Hyperscript. I can't wait to start using it ;)
If you're looking for some head-spinning inspiration on this, here's a great (tangentially-related) article by the original creator of Go: https://commandcenter.blogspot.com/2014/01/self-referential-functions-and-design.html
He shows how to make functions that 1) perform an action, then 2) return another function that undoes the action.
The larger context of his article is also pretty interesting. I thought that this do/undo feature might spark some ideas for htmx, too.powerful-evening-99811
12/28/2020, 5:38 PMgorgeous-ghost-95789
12/28/2020, 5:46 PMgorgeous-ghost-95789
12/28/2020, 5:47 PMmysterious-toddler-20573
12/29/2020, 9:25 PMmysterious-toddler-20573
12/29/2020, 9:25 PMmysterious-toddler-20573
12/29/2020, 9:25 PMmysterious-toddler-20573
12/29/2020, 9:25 PMmysterious-toddler-20573
12/29/2020, 9:25 PMhelpful-secretary-3515
12/29/2020, 9:44 PMhelpful-secretary-3515
12/29/2020, 9:44 PMhelpful-secretary-3515
12/29/2020, 9:45 PMhelpful-secretary-3515
12/29/2020, 10:10 PMhelpful-secretary-3515
12/29/2020, 10:10 PMhelpful-secretary-3515
12/29/2020, 10:10 PMmysterious-toddler-20573
12/29/2020, 10:58 PMHX-Request
header: https://htmx.org/reference/#request_headers