<script> function request(key) ...{ if(typeof(this)=="undefined")returnfalse; if(this.length>0) ...{ var s =this.split("&"); for(var i in s) ...{ var sp=s[i].split("=") if(sp[0]==key)return(sp[1]); } returnfalse; } elsereturnfalse } function getAllKey() ...{ if(typeof(this)=="undefined")returnfalse; var arr=new Array; if(this.length>0) ...{ var s =this.split("&"); for(var i in s) ...{ var sp=s[i].split("="); arr.push(sp[0]); } return arr; } elsereturnfalse } String.prototype.request=request String.prototype.getAllKey=getAllKey //=================================================== var url=location.search.substr(1) //action=reply&forum=3&topic=1469 var arg=url.getAllKey() alert(arg) document.write("提交参数:"+arg) for(var cou in arg ) document.write("<br>参数"+arg[cou]+"的值为:"+url.request(arg[cou])+"<br>") </script>