3 ms·
that would probably be best accomplished w/ a custom htmx:configRequest handler: https://htmx.org/events/#htmx:configRequest https://htmx.org/events/#htmx:conf
by recursivedoubts 4y ago
that would probably be best accomplished w/ a custom htmx:configRequest handler:
https://htmx.org/events/#htmx:configRequest https://htmx.org/events/#htmx:configRequest
you could jam the outerHTML of the detail.target into the detail.parameters map, maybe based on the presence of an attribute...
- mhitza 4y agoI'm gonna make a note on that when I have cycles to burn to experiment with htmx. From my understanding of reading that section, parameters being a container of kv pairs, I'd have to hack on the internals of htmx for it to be able to send a pure string (not form/multipart) as the body of a post/put request. If I get around of experimenting with that, and it fits my flow, would that be something you'd accept back into the project as a contribution to the code?
- recursivedoubts 4y agoi don't think you'd need to hack the internals, you just hook into that event to do what you need: htmx.on("htmx:configRequest", function(evt) { evt.detail.parameters['my-html'] = evt.target.outerHTML; // or whatever } you can jump on the discord and we can help you out when the time comes: https://htmx.org/discord https://htmx.org/discord