JS获取url请求参数,代码如下: // 获取url请求参数 function getQueryParams() { var query = location.search.substring(1) var arr = query.split('&') var params = {} for (var i = 0; i < arr.length; i++) { var pair = arr[i].split('=') params[pair[0]] = pair[1] } console.l
js实现: <script> function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r != null) return unescape(r[2]); return null; } window.on