From ed02ccffb07a41e86a52a870e8f0abdc5d5078d0 Mon Sep 17 00:00:00 2001 From: pacien Date: Wed, 24 Oct 2018 04:39:48 +0200 Subject: Use URL anchor to avoid query cache miss --- pointless/viewer/init.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pointless/viewer/init.js') diff --git a/pointless/viewer/init.js b/pointless/viewer/init.js index 01f550c..e76ab1b 100644 --- a/pointless/viewer/init.js +++ b/pointless/viewer/init.js @@ -20,7 +20,7 @@ const params = function() { const queryDict = {}; - location.search.substr(1).split("&").forEach(function(item) { + location.hash.substr(1).split("&").forEach(item => { const pair = item.split("="); queryDict[pair[0]] = pair[1]; }); @@ -58,5 +58,10 @@ function init() { viewer.load(params["file"]); } +function load(file) { + location.hash = "file=" + file; + location.reload(); +} + if (isController()) init(); -- cgit v1.2.3