« March 23, 2004 | Main | March 25, 2004 »
March 24, 2004
*.ipchina.org 域名系统改版 我爱网络
1.首页修改2.注册页面修改-----> 1.首页和 IPCN 整体风格保持一致 呵呵:P显示了现有用户数量和域名数量(其中子域个数)强化首页概念给出登录窗口淡化登录概念不登录照了解faq 首页放了一份-----> 2.注册页面增加判断特别提示不要用 @126.com 注册被通过javascript提示简单放了几个 JavaScript 函数过去附下:<script language="JavaScript"><!--/*[功能] 判断该变量是否存在,防止报错[参数] obj要检查的变量名称*/function isVarDefined(obj) { if(typeof(obj)=="undefined") { return false; } else { return true; }}/*[功能] 检验字符串长度[参数] str 要检验字符串*/function codeLength(str){ len2=0; for (var ci=0;ci<str.length;ci=ci+1){ var code= str.charCodeAt(ci); if (code<128) len1=1; else len1=2; len2=len2+len1; } return len2;}//函数介绍:判断输入字符串长度function checkString(field,fieldName,lengths,flag) { if (!isVarDefined(field)) { alert('类型未定义,可能网页没有完全载入或者程序错误。'); return false; } if ((flag!=0) && (field.value=='')) { alert(fieldName+'不能为空。'); field.focus(); field.select(); return false; } if ((lengths>0) && (codeLength(field.value)>lengths)) { alert(fieldName+'的长度不能超过'+lengths.toString(10)+'字节。'); field.focus(); field.select(); return false; } return true;}//判断填写的数据只能是英文或数字function checkString2 (field,fieldName,length,flag) { if (!isVarDefined(field)) { alert('类型未定义,可能网页没有完全载入或者程序错误。'); return false; } if ((flag!=0) && (field.value=='')) { alert(fieldName+'不能为空。'); field.focus(); field.select(); return false; } for (i=0;i<field.value.length;i=i+1) { var code= field.value.charCodeAt(i); if (code>128) { alert (fieldName+'不能填写汉字。'); field.focus(); field.select(); return false; } } if ((length>0) && (codeLength(field.value)>length)) { alert(fieldName+'的长度不能超过'+length+'字节。'); field.focus(); field.select(); return false; } return true;}function Em(str){return(/^([.w-]){1,}@([w-]){2,}(.([w]){2,}){1,}$/.test(str))}function checkEmail(field,flag) { if (!isVarDefined(field)) { alert('类型未定义,可能网页没有完全载入或者程序错误。'); return false; } if ((flag==1) && (field.value=='')) { alert("Email不能为空"); field.focus(); //field.select(); return false; } if (field.value!="") { if (!Em(field.value)) { alert("Email格式错误,正确格式“xxxx@yyyy.zzz”。"); field.focus(); //field.select(); return false; } } if (/@126.com$/.test(field.value)){ alert("请不要用 @126.com 邮箱注册"); field.focus(); field.select(); return false; } return true;}/*[功能] 焦点定位在第一个输入框*/function firstInput() { for (i=0;i<document.forms.length;i++) { for (j=0;j<document.forms[i].elements.length;j++) { e=document.forms[i].elements[j]; if (e.type=="text") { e.focus(); return false; } } }}function preSubmitCheck(myform){ if(!checkString(myform.user,'帐号',20,1)) return false; if(!checkString(myform.name,'姓名',20,1)) return false; if(!checkString(myform.password,'密码',20,1)) return false; if(!checkString(myform.password2,'确认密码',20,1)) return false; if(!checkEmail(myform.email,1)) return false; if(!checkString(myform.bbsid,'BBS ID',16,1)) return false; if(!checkString(myform.auth,'附加认证码',8,1)) return false; if (myform.password.value!=myform.password2.value) { alert("密码不一致,请重新填写。"); myform.password.focus(); return false; }}--></script> More...Posted by windtear at 1:28 PM