From 7a23ae28d67d80ad705a46a9bd182aea16e77300 Mon Sep 17 00:00:00 2001 From: "J. P. Savard" Date: Wed, 11 Dec 2024 12:52:47 -0500 Subject: [PATCH] location.hash --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index bc59a67..d82071f 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ fetch("rankings.json").then(r=>r.json()) $("#season").appendChild(option); }); $("#season").onchange = load; - $("#season").value = "2024"; + $("#season").value = location.hash == '' ? 2024 : location.hash.substring(1); load(); }); @@ -76,6 +76,7 @@ function load() ]}; var year = parseInt($("#season").value); var yy = year+""+(year+1); + location.hash = year; for(var d = 0; d < 2; d++) query(d,"gameTypeId=2 and franchiseId in ("+seasons[year][d].join(",")+") and opponentFranchiseId in ("+seasons[year][d].join(",")+") and seasonId="+yy) .then(res=>{