function getParam(key) { var tmp = location.search; tmp = decodeURIComponent(tmp); var index = tmp.indexOf(key); var length = key.length; var value; if(index != -1){ var start = index+length+1; var end = tmp.indexOf('&',start); if(end == -1){ value =…
//获取url参数的值:name是参数名 function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) { return (r[2]); } return null;…
获取指定url参数值 /* 获取某url中的某参数值 调用:GetUrlQueryString("[url地址]","[参数名]"); */ function GetUrlQueryString(url,name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = url.substring(url.indexOf("…
function getURL(){ var args = {}; var query = location.search.substring(1); //获得了当前链接的中?号后的参数 var pairs = query.split("&"); for(var i = 0; i < pairs.length; i++) { var pos = pairs[i].indexOf('='); if (pos == -1) continue; var argname = pa…