$.urlParam =
function
(name){
var
results =
new
RegExp(
'[\?&]'
+ name +
'=([^&#]*)'
).exec(window.location.href);
if
(results==
null
){
return
null
;
}
else
{
return
results[1] || 0;
}
}
console.log($.urlParam(
'param1'
));
References :
Get URL parameters using jQuery