here is simple scrypt to get url parameter, return value is an array of params.
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; });
return vars;
}
example :
var pr = getUrlVars()["act"];
if(pr === 2){
// act value = 2
// do whatever you want
}
have fun :)
Post a Comment