/**
* name是你要获取的参数名称
*/
getUrlParam(name) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for(var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if(pair[0] == name) {
return pair[1];
}
}
return(false);
}
/**
* 获取url参数
*/
function I(name) {
var def; //默认值
if (typeof (arguments[1]) == "undefined") {
def = '';
} else {
def = arguments[1];
}
var param = window.location.search; //URL参数
if (param == '') {
return def;
}
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = param.substr(1).match(reg);
if (r == null) {
return def;
}
return (r[2]);
}