// jscript 文件 var base={ version:"1.0", createdate:'2008-08-28', releasedate:'', init:function(){ //判断浏览器 var nu=navigator.useragent; this.isopera=window.opera && opera.buildnumber; this.iswebkit = /webkit/.test(ua); this.isoldwebkit = t.iswebkit && !window.getselection().getrangeat; this.isie = !t.iswebkit && !t.isopera && (/msie/gi).test(ua) && (/explorer/gi).test(navigator.appname); this.isie6 = t.isie && /msie [56]/.test(ua); this.isgecko = !t.iswebkit && /gecko/.test(ua); this.isgecko3 = t.isgecko && /(firefox|minefield)\/[3-9]/.test(ua); this.ismac = ua.indexof('mac') != -1; }, is:function(o,style){//判断类型,o为对象,style为类型如string,object var n=typeof(o);//typeof取得对象类型,但数组和null取到的都是object对象typeof一般只能返回如下几个结果:number,boolean,string,function,object,undefined if(!t) return n!='undefined'; if(t=='array' && (o instanceof array)) //instanceof同样也是判断对象类型,如果o是array类型,则返因结果为true return true; return n==t; }, isfunction:function(fn){ return !!fn && typeof fn != "string" && !fn.nodename && fn.constructor != array && /function/i.test( fn + "" ); }, each:function(obj,fn,args){//动态创建对象,obj为对象,fn为对象方法,args:参数 var n,l,val; if(!obj) return 0; args =args|| obj; if(typeof(obj.length)!='undefined'){ for(n=0,l=obj.length;n0) { document.getelementbyid("showmessage").innerhtml=""; document.getelementbyid("showmessage").style.color="red"; document.getelementbyid("showmessage").innerhtml="该用户名以被使用"; document.getelementbyid(id).focus(); document.getelementbyid("title").innerhtml=""; } else { document.getelementbyid("showmessage").innerhtml=""; document.getelementbyid("showmessage").style.color="green"; document.getelementbyid("showmessage").innerhtml="用户名可以使用"; document.getelementbyid("title").innerhtml=""; } }); } }