summaryrefslogtreecommitdiff
path: root/static/js/reload.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/reload.js')
-rw-r--r--static/js/reload.js8
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);