From: Jan Michel Date: Wed, 5 Feb 2020 14:47:05 +0000 (+0100) Subject: Add option to use xml pages with URL parameters X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=465ae9819d2d014bf308bbf63747fc570fc269f2;p=daqtools.git Add option to use xml pages with URL parameters --- diff --git a/web/htdocs/scripts/xmlpage.js b/web/htdocs/scripts/xmlpage.js index 0b397d5..60d641d 100644 --- a/web/htdocs/scripts/xmlpage.js +++ b/web/htdocs/scripts/xmlpage.js @@ -112,23 +112,23 @@ } function eatCookies() { - var t = getCookie("address"+currentpage); + var t = getCookie("address",currentpage); if (t != "" && document.getElementById("address")) { document.getElementById("address").value = t; } - t = getCookie("period"+currentpage); + t = getCookie("period",currentpage); if (t != "" && document.getElementById("period")) { document.getElementById("period").value = t; } - t = getCookie("target"+currentpage); + t = getCookie("target",currentpage); if (t != "" && document.getElementById("target")) { document.getElementById("target").value = t; } - t = getCookie("cache"+currentpage); + t = getCookie("cache",currentpage); if (t != "" && document.getElementById("cache")) { document.getElementById("cache").checked = (t=="true")?true:false; } - t = getCookie("rate"+currentpage); + t = getCookie("rate",currentpage); if (t != "" && document.getElementById("rate")) { document.getElementById("rate").checked = (t=="true")?true:false; } @@ -147,8 +147,17 @@ } /*From w3schools.com*/ - function getCookie(cname) { - var name = cname + "="; + function getCookie(cname,pagename) { +//URI + var hash = (location.hash ||'').replace(/^#/,'').split('&'); + for(i=0; i