//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;
};
//只取一个:
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 getQueryString