PLAY PODCASTS
Advanced htmx: hx-push-url and hx-replace-url
Season 2 · Episode 1

Advanced htmx: hx-push-url and hx-replace-url

hx-pod

February 24, 20249m 46s

Audio is streamed directly from the publisher (media.transistor.fm) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

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"

Topics

htmx javascript programming laravel livewire minimalism coding html simplicity