faint,将server和client的概念搞清楚,就知道是否可以了

解决方案 »

  1.   

    是嘛,Request.form是服务器端语句。
      

  2.   

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    /**
     *  取得当前页的参数值
     *  [email protected]
     *  
     */
    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>
      

  3.   

    不好意思,有个错误
    srch = srch.substring(1,srch.length-1);
    -->
    srch = srch.substring(1,srch.length);
      

  4.   

    get是通过分解url来实现的,并不是真正的接收