function getUrlParam(strUrl) { var url, pos, urlStr, para; url = strUrl || window.location.href; pos = url.indexOf("?") if(pos <= 0) return; url = url.substring(pos + 1); var params = url.split("&"); if(params == null || params.length == 0) return; var paramsObj = {}; for(var i = 0; i < params.length; i++) { var keyvalue = params[i].split("="); paramsObj[keyvalue[0]] = decodeURIComponent(keyvalue[1]); } return paramsObj }
标签:url,pos,strUrl,js,获取,参数 From: https://www.cnblogs.com/privateLogs/p/17384664.html