You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a specific case where I need to replace the whole document without making a redirect.
This replacement is set from the server side.
To do so, I use the "HX-Retarget": "body" and "HX-Reswap": "innerHTML" headers in the response.
As the head (styles, etc.) is also changed, I use the head-support extension.
With these two things I am almost there. The only part of the document I can't change is the html tag itself or the body tag itself. This html tag has a data-theme attribute that enables some styling. The new page shouldn't have this styles, so it hasn't this html attribute.
Is there any way to replace/remove the html tag attributes with the new ones sent by the response?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a specific case where I need to replace the whole document without making a redirect.
This replacement is set from the server side.
To do so, I use the
"HX-Retarget": "body"
and"HX-Reswap": "innerHTML"
headers in the response.As the head (styles, etc.) is also changed, I use the head-support extension.
With these two things I am almost there. The only part of the document I can't change is the
html
tag itself or thebody
tag itself. This html tag has adata-theme
attribute that enables some styling. The new page shouldn't have this styles, so it hasn't this html attribute.Is there any way to replace/remove the html tag attributes with the new ones sent by the response?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions