Sha256: 6dc2c9c90cc925f414b0da37dfc32ed904809d0eab820de3514da03093c7eda0
Contents?: true
Size: 1.19 KB
Versions: 152
Compression:
Stored size: 1.19 KB
Contents
function resultPage2(queryParams) { var newUrl = window.location.href; if (!newUrl.includes("?")) { setParams(queryParams); } else { setParams(queryParams); gtag("event", "page_view", { page_location: window.location.pathname + location.search, }); } } function setParams(queryParams) { let url = window.location.protocol + "//" + window.location.host + "/" + permaLink + "?"; for (queryP of queryParams) { var value; if (queryP.values.tagName == "INPUT") { value = queryP.values.value; } else if (queryP.values.tagName == "SELECT") { value = queryP.values.selectedIndex; } if (history.pushState) { var str = "&" + queryP.name + "=" + value; url = url + str; } } window.history.pushState({ path: url }, "", url); } function setParamValues(queryParams) { const params = new URLSearchParams(window.location.search); for (queryP of queryParams) { var parameter_value = params.get(queryP.name); if (queryP.values.tagName == "INPUT") { queryP.values.value = parameter_value; } else if (queryP.values.tagName == "SELECT") { queryP.values.selectedIndex = parameter_value; } } }
Version data entries
152 entries across 152 versions & 1 rubygems