limited-sunset-88973
06/05/2022, 2:30 PMmysterious-toddler-20573
06/05/2022, 3:29 PMsalmon-oil-67352
06/05/2022, 11:12 PM<div "hx-swap-oob="true"></div>.
I think it's because it's invalid HTML to have a table row and a div together in the response? When i remove the table row it works. Is this normal behaviour?mysterious-toddler-20573
06/05/2022, 11:18 PMmysterious-toddler-20573
06/05/2022, 11:18 PMhtmx.config.useTemplateFragments to true and it should work 😑mysterious-toddler-20573
06/05/2022, 11:19 PMbrainy-ice-92385
06/06/2022, 6:37 AM<select name="url" hx-get="/" hx-swap="none" _="on change set my @hx-get to my value then htmx.process(me) then send redirect to me" hx-trigger="redirect">red-actor-7071
06/06/2022, 6:49 AMred-actor-7071
06/06/2022, 7:12 AMmysterious-toddler-20573
06/06/2022, 1:27 PMmysterious-toddler-20573
06/06/2022, 1:39 PMbrainy-ice-92385
06/06/2022, 1:42 PMcreamy-dawn-16627
06/06/2022, 5:42 PMproud-guitar-95305
06/07/2022, 3:29 AMproud-guitar-95305
06/07/2022, 3:31 AMmysterious-toddler-20573
06/07/2022, 3:35 AMmysterious-toddler-20573
06/07/2022, 3:54 AMgorgeous-ghost-95789
06/07/2022, 4:27 AM/users lists all users, /users/:id details on a specific user, /users/:id/posts list all posts for a user, etc.) and other extraneous ones that help generate the HTML (authentication, lookup codes, etc).
For these kinds of endpoints, I have two kinds of output templates: an HTML encoder (template) that generates the htmx fragment, and a JSON encoder that returns the primary query as JSON. You can determine which encoder to use with a URL (/users vs /users/json) or nn extension (/users/1.html vs. /users/1.json) or using the "Accept" request header. The "Accept" header is the most "RESTful" of the methods, but it has some drawbacks in terms of developer ergonomics.
Every endpoint doesn’t need to have a JSON fork, just the big ones that support your API. This has worked out really nicely so far, though my need for the JSON endpoints has dwindled as I've dug deeper into the htmx/hyperscript ecosystem.tall-dinner-62086
06/07/2022, 11:10 AMbrainy-ice-92385
06/07/2022, 1:51 PMtall-dinner-62086
06/07/2022, 1:52 PMbrainy-ice-92385
06/07/2022, 1:55 PMproud-guitar-95305
06/07/2022, 2:03 PMtall-dinner-62086
06/07/2022, 2:05 PMgorgeous-ghost-95789
06/07/2022, 2:10 PMjolly-kite-167
06/07/2022, 2:11 PMjolly-kite-167
06/07/2022, 2:11 PMgorgeous-ghost-95789
06/07/2022, 2:11 PMgorgeous-ghost-95789
06/07/2022, 2:13 PM