diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-08-22 12:14:40 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-08-22 12:14:40 +0200 |
commit | 744a54b7074657131ba76a7cee92809410852506 (patch) | |
tree | 4eab990ac2cfd633e700e1e2e4ae9530a7649e07 /static/js/reload.js | |
parent | 19a6b7679964dfe3927ad6cd2b314ae5a9bb1a8f (diff) |
Correctly append ajax=1 GET parameter to reload URL
Diffstat (limited to 'static/js/reload.js')
-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); |