How can I get the query string from the browser url using client side js and set it as a variable to use in some server side scripting?
Client side script:
var project = getQueryString("P");
function getQueryString(param) {
var queryString = window.location.search.substring(1);
splitQueryString = queryString.split("&");
for (i=0; i<splitQueryString.length; i++) {
query = splitQueryString[i].split("=");
if (query[i] == param) {
return query[1];
}
}
}
Server side script:
response.write ('<td><a href="/index.asp?P=' + project + ">' + obj.BODY[i].NAME + '</a></td>');