getArgs: function(key){
var args = {};
if(location.search.split('?') <2 ){
return null;
}
var search = decodeURIComponent(location.search);//包含中文特殊字符的解码
search =search.split('?')[1].split('&');
search.forEach(function(item){
var kv = item.split('=');
args[kv[0]] = kv[1];
});
if(!args[key]) {
args[key] = '';
}
return args[key];
},
www.baidu.com?id=12&time=30;
getArgs("id");//12
getArgs ("time");//30