You can retrieve the querystring from the url using the function below (taken from
StackOverflow: how-can-i-get-query-string-values[
^]):
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if(results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
I will leave opening the new window part to you (hint:
window.open
).
Hope that helps!