asp.net实现根据身份证判断性别和生日
本文导语: 代码示例: CordBirthday function showBirthday(val) { var birthdayValue; if(15==val.length) { //15位身份证号码 birthdayValue = val.charAt(6)+val.charAt(7); if(parseInt(birthdayValue)=2;i--) x = x + ...
CordBirthday
function showBirthday(val)
{
var birthdayValue;
if(15==val.length)
{ //15位身份证号码
birthdayValue = val.charAt(6)+val.charAt(7);
if(parseInt(birthdayValue)=2;i--)
x = x + (square(2,(i-1))%11)*parseInt(Num.charAt(19-i-1));
x%=11;
y=12-x;
if (x==0)
y='1';
if (x==1)
y='0';
if (x==2)
y='X';
return y;
}
// 求得x的y次方
function square(x,y)
{
var i=1;
for (j=1;j