标签:++ for res dex class 多参数 eval substr amp
//获得url参数,只接收一个值 function oneValues() { var result; var url = window.location.search; //获取url中"?"符后的字串 if (url.indexOf("?") != -1) { result = url.substr(url.indexOf("=") + 1); } return result; } //接受url多参数 function manyValues(){ var url=window.location.search; if(url.indexOf("?")!=-1){ var str = url.substr(1); strs = str.split("&"); var key=new Array(strs.length); var value=new Array(strs.length); for(i=0;i<strs.length;i++){ key[i]=strs[i].split("=")[0] value[i]=unescape(strs[i].split("=")[1]); alert(key[i]+"="+value[i]); } } } $(function(){ manyValues(); });
标签:++ for res dex class 多参数 eval substr amp
原文地址:https://www.cnblogs.com/dzcici/p/10102121.html