ARTICLE AD BOX
I'm building a small Single‑Page Application that does not require SEO. It runs entirely from a single HTML file and doesn't need any server‑side routing or additional requests.
I'm choosing between two client‑side routing approaches:
Query parameters, e.g. index.html?p=about Hash fragments, e.g. index.html#aboutBoth approaches work with history.pushState() and both create browser history entries. Since JavaScript intercepts navigation, neither method triggers a page reload, and most behavior differences can be handled in code.
My questions
Are there concrete technical advantages of using query parameters vs hash fragments for SPA routing? Are there any non‑obvious edge cases or browser quirks that make one approach more reliable than the other?If the two approaches are mostly equivalent, I'm interested in understanding when parameters are preferred and when hash fragments are the better choice.
