Move get url to self referential function

This commit is contained in:
A McIlwraith 2024-08-20 13:08:46 -04:00
parent 140b239cfc
commit acdb794971

View File

@ -102,7 +102,19 @@ const getURLVars = () => {
}
module.exports = {
url: getURLVars(),
url: (() => {
var v = {};
if (location.search.length > 0) {
var qs = (location.search.substr(1)).split("&");
for (var i = 0; i < qs.length; i++) {
var t = qs[i].split("=");
if (t[1].length > 0) {
v[t[0]] = decodeURIComponent(t[1].replace(/\+/g, '%20'));
}
}
}
return v;
})(),
cookie: {
set: (name, value, expires, path, domain, secure) => {
switch(typeof expires) {