url跳转路径参数获取

function getUrlParam1(name){
//正则表达式过滤
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]); return null;

}
posted @ 2018-12-18 19:26  shuihanxiao  阅读(602)  评论(0编辑  收藏  举报