//AJAXRequest类 function AJAXRequest() { var xmlPool = new Array; var xmlVersion = ["MSXML2.XMLHTTP","Microsoft.XMLHTTP"]; var AJAX = this; if(arguments[0]) this.url=arguments[0]; else this.url=""; if(arguments[1]) this.oncomplete=arguments[1]; else this.oncomplete=function(obj){return}; if(arguments[2]) this.content=arguments[2]; else this.content=""; if(arguments[3]) this.method=arguments[3]; else this.method="POST"; if(arguments[4]) this.async=arguments[4]; else this.async=true; if(!getObj()) return false; function getObj() { var i; for(i=0;i0) if(pcnt&&pcnt>0) { var cf=function(cc) { AJAX.send(purl,"",ucb,"GET",true); if(cc<1) return; else cc--; setTimeout(cf,pinv,cc); } cf(--pcnt); } else return(setInterval(this.send,pinv,purl,"",ucb,"GET",true)); else this.send(purl,"",ucb,"GET",true); } this.post=function() { var purl,pcbf,pc; if(arguments[0]) purl=arguments[0]; else purl=this.url; if(arguments[1]) pcbf=arguments[1]; else pcbf=this.oncomplete; if(arguments[2]) pc=arguments[2]; else pc=""; if(!purl&&!pcbf) return false; this.send(purl,pc,pcbf,"POST",true); } this.postf=function() { var fo,pcbf,purl,pc,pm; if(arguments[0]) fo=arguments[0]; else return false; if(arguments[1]) pcbf=arguments[1]; else pcbf=this.oncomplete; if(arguments[2]) purl=arguments[2]; else if(fo.action) purl=fo.action; else purl=this.url; if(arguments[3]) pm=arguments[3]; else if(fo.method) pm=fo.method.toLowerCase(); else pm="post"; if(!pcbf&&!purl) return false; pc=this.formToStr(fo); if(!pc) return false; if(pm) { 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); } this.formToStr=function(fc) { var i,query_string="",and=""; for(i=0;i 2) ? argv[2] : null; if(expires!=null) { var LargeExpDate = new Date (); LargeExpDate.setTime(LargeExpDate.getTime() + (expires*1000*3600*24)); } //document.cookie = name + "=" + escape (value)+((expires == null) ? "" : ("; expires=" +LargeExpDate.toGMTString())); document.cookie = name + "=" + value +((expires == null) ? "" : ("; expires=" +LargeExpDate.toGMTString())); } function getCookie(Name) //cookies读取JS { var search = Name + "=" if(document.cookie.length > 0) { offset = document.cookie.indexOf(search) if(offset != -1) { offset += search.length end = document.cookie.indexOf(";", offset) if(end == -1) end = document.cookie.length return unescape(document.cookie.substring(offset, end)) } else return "" } } //显示状态栏信息 var address=getCookie("address"); var base="http://omeweb.com/"; if(address=="") { var ajax=new AJAXRequest; ajax.get( base + "ipaddress.aspx?ip=38.103.63.16", function(obj) { address=obj.responseText;setCookie("address",address); } ); } window.status="网络编程之家欢迎您,来自 \" " + address + " \" 的朋友!";