From dbb9903feef02eec54546480bad495ad9d363854 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 12 Jan 2023 20:55:22 +0000 Subject: [PATCH] Fix window.location properties to match protocol. Signed-off-by: Fred Boniface --- static/js/board.js | 2 +- static/js/index.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/static/js/board.js b/static/js/board.js index 577b042..93d6b58 100644 --- a/static/js/board.js +++ b/static/js/board.js @@ -35,7 +35,7 @@ async function getQuery(param) { } async function publicLdb(stn) { - var url = `http://${window.location.host}/api/v1/ldb/${stn}`; + var url = `${window.location.origin}/api/v1/ldb/${stn}`; var resp = await fetch(url); return await resp.json(); } diff --git a/static/js/index.js b/static/js/index.js index d4d8aec..4e7bfbe 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -11,7 +11,5 @@ async function sidebarClose() { } async function gotoBoard(station){ - console.log(`Finding ${station}`) - var url = `http://${window.location.host}/board.html/${station}`; - window.location.assign(`board.html?stn=${station}`) + window.location.assign(`${window.location.origin}/board.html?stn=${station}`) } \ No newline at end of file