Episode Details
Back to EpisodesAdvanced htmx: hx-push-url and hx-replace-url
Season 2
Episode 1
Published 2 years ago
Description
Push your ajax route to the url bar! Now you've got access to the back button again.
.. but what happens when you refresh?
Work with the browser history on any htmx request with hx-push-url and hx-replace-url.
PUSH it to the Browser history stack:
hx-get="/account/details" hx-push-url="true"
REPLACE the current browser history stack:
hx-get="/account/details" hx-replace-url="true"