/********Start***********/ /*获取地址栏参数*/ function getRequest(){ var url = location.search; //获取url中"?"符后的字串 var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); strs = str.split("&"); for(var i = 0; i < strs.length; i ++) { theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]); } } return theRequest; } var Request = new Object(); Request = getRequest(); var typeid; typeid = Request['id']; /***********END***********/ /********地址栏有中文也可以***********/ function getUrlParam(key) { // 获取参数 var url = window.location.search; // 正则筛选地址栏 var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)"); // 匹配目标参数 var result = url.substr(1).match(reg); //返回参数值 return result ? decodeURIComponent(result[2]) : null; } /********地址栏有中文也可以***********/