From 575fb85be86f2962ea48da0d4f1da0b1e1712b4e Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Fri, 7 Oct 2022 18:51:18 -0700 Subject: [PATCH] Use event listener instead of attribute --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 11a9238..bd6b8d1 100644 --- a/index.html +++ b/index.html @@ -164,7 +164,7 @@ route(e.target.dataset.route); }); } - window.onpopstate = _ => showPage(window.location.pathname.substring(1)); + window.addEventListener('popstate', _ => showPage(window.location.pathname.substring(1))); // Show the current URL (to support direct linking aka deep links) showPage(window.location.pathname.substring(1)); -- 2.47.3