Single-page-application with fixed header/footer with HTMX + URL browsing history #964
josephernest
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have an application with fixed header and footer (it is important that they are not reloaded when we navigate through pages). The attribute
hx-push-urlallows to have browsing history through the pages: we can use the "back" and "forward" buttons, and it works as expected:index.html:newpage1:newpage2:After having clicked on "Go to newpage1" button, the container div is replaced by the content of
newpage1as expected and the browser URL is nowhttp://127.0.0.1/newpage1.Problem: if we enter this URL directly in the browser, we won't have the full page, but only the container
<div id="container">...</div>.What is the common HTMX solution to this problem when we build a single page application?
Beta Was this translation helpful? Give feedback.
All reactions