Use window.location.pathname instead of .search

This commit is contained in:
Adam Goldsmith 2024-09-15 14:39:31 -04:00
parent e15944669f
commit f41c4e4e15

View File

@ -2,7 +2,7 @@
<div id="status">Trying to find the right wiki page...</div>
<script>
const status_div = document.getElementById("status");
const asset_tag = window.location.search.slice(1);
const asset_tag = window.location.pathname.slice(1);
fetch(
`https://wiki.claremontmakerspace.org/api.php?action=ask&query=[[Asset Tag::${asset_tag}]]&format=json&api_version=3&origin=*`