function getUrlParams(){ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数(name)的正则表达式. var r = window.location.search.substr(1).match(reg); // 用这则表达式筛选出含有目标参数(name)的 r. if (r != null) return unescap
function getUrlRequestParam(name) { var paramUrl = window.location.search.substr(1); var paramStrs = paramUrl.split('&'); var params = {}; for (var index = 0; index < paramStrs.length; index++) { params[paramStrs[index].split('=')[0]] = decodeURI(p