//根据传递过来的参数name获取对应的值 //name是要获取url的参数名 function getParameter(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i"); var r = location.search.substr(1).match(reg); if (r!=null) return (r[2]); return null; }
标签:return,name,url,js,获取,参数,reg From: https://www.cnblogs.com/xiaofeilin/p/16614411.html