3 ms·
This won't work if a response is meant to swap out a div, the first response completing will swap it out - if this response isnt compatible with the same selec
by sauercrowd 2y ago
This won't work
if a response is meant to swap out a div, the first response completing will swap it out - if this response isnt compatible with the same selector (e.g. a #response is not available) a second completing response won't be able to update the UI
- naasking 2y agoThere are many choices here, such as never setting outerHTML but only innerHTML/nested content. Also, "processing responses in order" doesn't necessarily mean "immediately mutate DOM for each response", eg. defer if there are in-flight requests and aggregate changes. htmx arguably gives you too much flexibility which is why there are no straight answers that work for all scenarios.