https://htmx.org logo
I think the code that I have above will do the hea...
# htmx-general
m
I think the code that I have above will do the head merge in the same manner, not as object oriented and more direct, but it does handle both linked as well as inline scripts, css, etc. It does remove head elements no longer present, and htmx's focus on HTML fragments, rather than complete pages, introduces another wrinkle that we need to think about. Another aspect to consider is the history cache, which is one reason why I'm leaning towards integrating this into htmx, rather than as an extension. For the swapping issue, this seems like a perfect place to use an extension, maybe
multi-swap
?
Copy code
html
<button hx-get="/whatever" hx-ext="multi-swap" hx-swap="multi: #foo:innerHTML, #bar:outerHTML">
  Multi-Swap It
</button>
Once we prove it with an extension, I could see moving this into core as well.