function cidInfo(sId){ var iSum=0 var info="" if(!/^\d{17}(\dx)$/i.test(sId))return false; sId=sId.replace(/x$/i,"a"); if(aCity[parseInt(sId.substr(0,2))]==null)return "Err or:非法地区"; sBirthday=sId.substr(6,4)+"-"+Number(sId.substr(10,2))+"-"+Number(sId.substr(12,2)); var d=new Date(sBirthday.replace(/-/g,"/")) if(sBirthday!=(d.getFullYear()+"-"+ (d.getMonth()+1) + "-" + d.getDate()))return "Err or:非法生日"; f or(var i = 17;i>=0;i --) iSum += (Math.pow(2,i) % 11) * parseInt(sId.charAt(17 - i),11) if(iSum%11!=1)return "Err or:非法证号"; return aCity[parseInt(sId.substr(0,2))]+","+sBirthday+","+(sId.substr(16,1)%2?"男":"女") }
document.write(cidInfo("380524198002300016"),"<br/>"); document.write(cidInfo("340524198002300019"),"<br/>") document.write(cidInfo("340524197711111111"),"<br/>") document.write(cidInfo("34052419800101001x"),"<br/>"); </script>
2.验证IP地址 <SCRIPT LANGUAGE="java script"> function isip(s){ var check=function(v){try{return (v<=255 && v>=0)}catch(x){return false}}; var re=s.split(".") return (re.length==4)?(check(re[0]) && check(re[1]) && check(re[2]) && check(re[3])):false }
var s="202.197.78.129"; alert(isip(s)) </SCRIPT>
3.加sp1后还能用的无边框窗口!! <HTML XMLNS:IE> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <IE:Download ID="include" STYLE="behavi or:url(#default#download)" /> <title>Chromeless Window</title>
<SCRIPT LANGUAGE="JScript"> /*--- Special Thanks F or andot ---*/
/* This following code are designed and writen by Windy_sk <seasonx@163.net> You can use it freely, but u must held all the copyright items! */
/*--- Thanks F or andot Again ---*/
上一篇:一些经常会用到的vbscript检测函数
下一篇:ASP分页
|