// 取当前页面名称(不带后缀名)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 strUrl=location.href; var arrUrl=strUrl.split("/"); var strPage=arrUrl[arrUrl.length-1]; return strPage;}
/* 获取页面路径中的查询参数*/ function getUrlParam() { var url = document.location.toString(); var arrObj = url.split("?"); var result = {}; if (arrObj.length > 1) { var arrPara = arrObj[1].split("&"); var arr; for (var i = 0; i < arrPara.length; i++) { arr = arrPara[i].split("="); result[arr[0]] = arr[1]; } } return result; }
新闻热点
疑难解答