diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/js/reload.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/static/js/reload.js b/static/js/reload.js index 183268d..2a3fbf3 100644 --- a/static/js/reload.js +++ b/static/js/reload.js @@ -7,7 +7,13 @@ document.addEventListener("DOMContentLoaded", function() { }; const fetchDepartures = () => { - fetch(window.location.href + '?ajax=1') + var fetchUrl = window.location.href; + if (fetchUrl.includes("?")) { + fetchUrl += "&ajax=1"; + } else { + fetchUrl += "?ajax=1"; + } + fetch(fetchUrl) .then(response => { if (!response.ok) { throw Error(response.statusText); |