location.search的正则获取url的参数记录
2018-12-05 本文已影响0人
chouchou723
sProp是需要获取的参数
getParameter(sProp) {
var re = new RegExp(sProp + "=([^\&]*)", "i");
var a = re.exec(document.location.search);
if (a == null)
return null;
return a[1];
},