//lastest:
var getArgs =function() {//get url querystring
var params=document.location.search,reg=/(?:^?|&)(.*?)=(.*?)(?=&|$ )/g,temp,args={};
while((temp=reg.exec(params))!=null) args[temp[1]]=decodeURIComponent(temp[2]);
return args;
};
//Just take one:
var queryString=function(key){
return (document.location.search.match(new RegExp("(?:^\? |&)" key "=(.*?)(?=&|$)"))||['',null])[1];
}
var args=getArgs();
alert(args.name " | " args.sex " | " args.age);
//Test link:
test getQueryString< /a>
ps: Don’t use it in the method Call the method in the method, otherwise you may always get the parameters of the last js file. To use it in the method, please save it with a variable first and get it directly in the method.