I'm still kind of confused with what you want to happen. But here I go, if you wanted to redirect a page using a javascript function, you may call window.location.href = 'url';
Then once you've redirected that user to the page and wanted to run some javascript function base on some get parameters, you can access the url's paramters using some function, see sample code below:
function getValue(url, name) {
var result = {};
var paramParts;
var params = (url.split('?')[1] || '').split('&');
for(var param in params) {
if (params.hasOwnProperty(param)) {
paramParts = params[param].split('=');
result[paramParts[0]] = decodeURIComponent(paramParts[1] || "");
}
}
if (result[name] === undefined && result[name] === null) {
result = '';
}
return result[name];
}
you may call that function like getValue(window.location.href, 'variable_name')
it will return the value of the parameter you wanted to check on
lambing
Junior Poster in Training
76 posts since Feb 2010
Reputation Points: 10
Solved Threads: 15
Skill Endorsements: 0
Question Answered as of 10 Months Ago by
lambing