I'm getting an url item with this code:
function GetQueryString(a)
{
a = a || window.location.search.substr(1).split('&').concat(window.location.hash.substr(1).split("&"));
if (typeof a === "string")
a = a.split("#").join("&").split("&");
if (!a) return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
var p = a[i].split('=');
if (p.length != 2) continue;
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
}
return b;
}
var qs = GetQueryString();
qs["item"]; // Item que eu estou pegando da url ex:
https://meusite.com/pagina.php?item=(valor que eu quero pegar)
And after doing this process, I would like that with the value obtained from
variable "qs" concatenate with the new page link that would be redirected after 3 seconds, I am using this code:
setTimeout("document.location = 'https://www.meusite.com/pagina.php?item='" + 'qs['item']',3000);
How can I fix this code?