]> git.ardis.lu - ardislu.dev/commitdiff
Make routing logic explicit
authorArdis Lu <ardisglu@gmail.com>
Fri, 5 Aug 2022 04:34:09 +0000 (21:34 -0700)
committerArdis Lu <ardisglu@gmail.com>
Fri, 5 Aug 2022 04:34:09 +0000 (21:34 -0700)
script.js

index 4fdcee0c350aac2328787b3b08121bd6bc1489ad..486683f73709b9dc2b9adced37326e8c15a77757 100644 (file)
--- 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 */
This page took 0.044111 seconds and 4 git commands to generate.