4 ms·
Stupid question, why doesn't htmx parse the response html and extract from that the relevant data out needs to fulfill the configuration? Feels a bit cumbersome
by tommica 3y ago
Stupid question, why doesn't htmx parse the response html and extract from that the relevant data out needs to fulfill the configuration? Feels a bit cumbersome to return the exact part of the response on server side, like the next page of the table, if it was requested with htmx, else return the full page.
This way htmx would be even easier to implement in any front-end.
Or maybe I am just crazy.
Edit: or is it this? https://htmx.org/docs/#selecting-content-to-swap https://htmx.org/docs/#selecting-content-to-swap
- spapas82 3y agoThis is how unpoly works (it receives the whole response and patches the page with the correct part of that response).
- tommica 3y agoOh that's cool!
- Lukas_Skywalker 3y agoRails does this with Turbo Frames [1]. When clicking a link that is contained in a <turbo-frame> element, the frame is automatically replaced if the response contains a frame with the same ID. 1: https://turbo.hotwired.dev/handbook/frames https://turbo.hotwired.dev/handbook/frames
- mst 3y agoIt is that, yes.