/** * 获取页面路径参数值 */ function getParams(key) { var result = {}; var paramStr = encodeURI(window.document.location.search); if (paramStr) { paramStr = paramStr.substring(1); var params = paramStr.split('&'); for (var p = 0; p < params.length; p++) { r
function getQueryStringByName(name) { var result = location.search.match(new RegExp("[\?\&]" + name + "=([^\&]+)", "i")); if (result == null || result.length < 1) { return ""; } return result[1]; } 例如: Re
// 取当前页面名称(不带后缀名)function getPageName1(){ var a = location.href; var b = a.split("/"); var c = b.slice(b.length-1, b.length).toString().split("."); return c.slice(0, 1);} //取当前页面名称(带后缀名)function getPageName2() { var str
function getUrlParams(){ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数(name)的正则表达式. var r = window.location.search.substr(1).match(reg); // 用这则表达式筛选出含有目标参数(name)的 r. if (r != null) return unescap