All you need to do is call this function with name of the variable that you want to filter and it will return the value back to you.
Hope it helps:
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}
var paramValue = getURLParameter('paramName');
//alert(paramValue);
NOTE:
- Replace 'paramName' with parameter for which you are looking to get value.
- Variable 'paramValue' stores the parameter value.
No comments: