You can do above task as below.
Step 1 : Get the query string from the 1st Url
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
As an example:
href="http://www.example.com/default.aspx?cat=paper
Above code will return :
{
"cat" : "paper",
}
Then you can get that value is as below:
var cat = getUrlVars()["cat"];
Step 2: Append above value when user clicks the 2nd url
For more info:
jquery get querystring from URL
I hope this will help to you.