mysterious-toddler-20573
10/18/2021, 6:28 PMhtml
<div ...
_="on htmx:afterSwap trigger done on #other-div"
...>
...
</div>
<div id="other-div" hx-trigger="done" ...>
...
</div>mysterious-toddler-20573
10/18/2021, 6:31 PMabundant-planet-84751
10/18/2021, 6:53 PMError: Expected event namemysterious-toddler-20573
10/18/2021, 6:54 PMmysterious-toddler-20573
10/18/2021, 6:54 PMmysterious-toddler-20573
10/18/2021, 6:55 PMhtml
<div ...
_="on htmx:afterSwap send done to #other-div"
...>
...
</div>
<div id="other-div" hx-trigger="done" ...>
...
</div>mysterious-toddler-20573
10/18/2021, 6:55 PMabundant-planet-84751
10/18/2021, 7:05 PMadamant-exabyte-92636
10/18/2021, 9:57 PMtrigger done on #otherDiv instead of send done to #otherDiv). I wonder whether it’s because it “rhymes” with on <event>:from #otherDiv? Or perhaps it feels like if you can use trigger event on the current element, why shouldn’t you be able to trigger event on #otherDiv? And yes, this is now a hyperscript channel againmysterious-toddler-20573
10/18/2021, 10:02 PMadamant-exabyte-92636
10/18/2021, 10:06 PMacceptable-article-91404
10/19/2021, 12:28 AMgentle-notebook-11755
10/19/2021, 12:50 AMhtmx:swapError. This error doesn't show up when I manually click on the button. I imagine there must be a better way to achieve what I want. Thank you!mysterious-toddler-20573
10/19/2021, 2:26 AMverified for your trigger:
html
<form hx-trigger='verified' ...>
...
</form>mysterious-toddler-20573
10/19/2021, 2:27 AMverfied eventmysterious-toddler-20573
10/19/2021, 2:27 AMmysterious-toddler-20573
10/19/2021, 2:29 AMhtml
<body hx-trigger='refresh' ...>
...
</body>
<script>
...
htmx.trigger("body", "refresh");
....
</script>mysterious-toddler-20573
10/19/2021, 2:29 AMmysterious-toddler-20573
10/19/2021, 2:29 AMgentle-notebook-11755
10/19/2021, 2:33 AMmysterious-toddler-20573
10/19/2021, 2:34 AMgentle-notebook-11755
10/19/2021, 2:34 AM{
"errorInfo": {
"error": "htmx:swapError",
"xhr": {},
"target": {},
"requestConfig": {
"parameters": {},
"unfilteredParameters": {},
"headers": {
"HX-Request": "true",
"HX-Trigger": null,
"HX-Trigger-Name": null,
"HX-Target": null,
"HX-Current-URL": "https://outset_craft.nitro/"
},
"target": {},
"verb": "get",
"errors": [],
"withCredentials": false,
"timeout": 0,
"path": "https://outset_craft.nitro/ ",
"triggeringEvent": {
"isTrusted": false
},
"elt": {}
},
"pathInfo": {
"path": "https://outset_craft.nitro/ ",
"finalPath": "https://outset_craft.nitro/ "
},
"elt": {}
},
"elt": {}
}mysterious-toddler-20573
10/19/2021, 2:34 AMhtmx.trigger() is just a wrapper around the normal javascript api to make it easier to dispatch eventsgentle-notebook-11755
10/19/2021, 2:34 AM<button class="pageReloader" aria-hidden="true" hx-push-url="false" hx-get="https://outset_craft.nitro/ " hx-select=".site" hx-target=".site" hx-swap="outerHTML swap:0.5s settle:0.5s" hx-indicator="#loader">mysterious-toddler-20573
10/19/2021, 2:35 AMmysterious-toddler-20573
10/19/2021, 2:35 AMmysterious-toddler-20573
10/19/2021, 2:36 AM.site doesn't exist?mysterious-toddler-20573
10/19/2021, 2:36 AMgentle-notebook-11755
10/19/2021, 2:36 AMut https://unpkg.com/htmx.org@1.6.0:1
lt https://unpkg.com/htmx.org@1.6.0:1
ot https://unpkg.com/htmx.org@1.6.0:1
r https://unpkg.com/htmx.org@1.6.0:1
(Async: setTimeout handler)
Gt https://unpkg.com/htmx.org@1.6.0:1
onload https://unpkg.com/htmx.org@1.6.0:1
(Async: EventHandlerNonNull)
Zt https://unpkg.com/htmx.org@1.6.0:1
Zt https://unpkg.com/htmx.org@1.6.0:1
d https://unpkg.com/htmx.org@1.6.0:1
onload https://unpkg.com/htmx.org@1.6.0:1
(Async: EventHandlerNonNull)
Zt https://unpkg.com/htmx.org@1.6.0:1
i https://unpkg.com/htmx.org@1.6.0:1
fetchResponse https://outset_craft.nitro/:287
doFetching https://outset_craft.nitro/:262
(Async: promise callback)
doFetching https://outset_craft.nitro/:262
knock_knock https://outset_craft.nitro/:197
(Async: EventListener.handleEvent)
knock_knock https://outset_craft.nitro/:190
<anonymous> https://outset_craft.nitro/:338
<anonymous> https://outset_craft.nitro/:340mysterious-toddler-20573
10/19/2021, 2:37 AM