From: Ardis Lu Date: Fri, 5 Aug 2022 04:34:09 +0000 (-0700) Subject: Make routing logic explicit X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=03e5a5b0cc9cc60967c48629982b6691e5bec922;p=ardislu.dev Make routing logic explicit --- diff --git a/script.js b/script.js index 4fdcee0..486683f 100644 --- a/script.js +++ b/script.js @@ -183,9 +183,11 @@ function route(href) { location.href = href; return; } - - history.pushState({}, '', url); - showPage(url.pathname); + // For all other routes, use client-side routing + else { + history.pushState({}, '', url); + showPage(url.pathname); + } } /* Set event handlers for client-side routing */