<SCRIPT LANGUAGE="JavaScript">
<!--
/**
 *  js取url参数的函数
 */
function Request(){
var srch = window.location.search;
if (srch.length==0) return null;
srch = srch.substring(1,srch.length-1);
this.nv = srch.split("&");
this.names = new Array();
this.values = new Array();
for (var i=0;i<this.nv.length;i++){
var tmp = this.nv[i].split("=")
this.names[i] = tmp[0];
this.values[i] = tmp[1];
}
this.getValue = function(name){
for(var i=0;i<this.names.length;i++){
if (this.names[i] == name) return this.values[i];
break;
}
return null;
}
return this;
}
var curReq = new Request();
alert(curReq.getValue("name"));//if (href=='url?name=gzh&id=1') return 'gzh';
//-->
</SCRIPT>