一个方便AJAX开发的通用类

2019-09-14 07:28:35王旭

            if(pm=="post")
                this.send(purl,pc,pcbf,"POST",true);
            else
                if(purl.indexOf("?")>0)
                    this.send(purl+"&"+pc,"",pcbf,"GET",true);
                else
                    this.send(purl+"?"+pc,"",pcbf,"GET",true);
        }
        else
            this.send(purl,pc,pcbf,"POST",true);
    }
    // formToStr
    // from SurfChen <surfchen@gmail.com>
    // @url     http://www.surfchen.org/
    // @license http://www.gnu.org/licenses/gpl.html GPL
    // modified by xujiwei
    // @url     http://www.xujiwei.cn/
    this.formToStr=function(fc) {
        var i,query_string="",and="";
        for(i=0;i<fc.length;i++) {
            e=fc[i];
            if (e.name!='') {
                if (e.type=='select-one') {
                    element_value=e.options[e.selectedIndex].value;
                }
                else if (e.type=='checkbox' || e.type=='radio') {
                    if (e.checked==false) {
                        continue;    
                    }