edit test.html
<div id="test"></div> <script> const p = new URLSearchParams(window.location.search); if (p.has('y')) { year = parseInt(p.get('y'), 10); document.getElementById("test").innerHTML = year; } </script>
test.html?y=1000
result:
1000
Andrew Choi 蔡健發 (清心明月), 不務正業的行街
My Notebook
edit test.html
<div id="test"></div> <script> const p = new URLSearchParams(window.location.search); if (p.has('y')) { year = parseInt(p.get('y'), 10); document.getElementById("test").innerHTML = year; } </script>
test.html?y=1000
result:
1000