转载来的计算方法
var birthday=new Date("1989-06-25".replace(/-/g, "\/"));
var d=new Date();
var age = d.getFullYear()-birthday.getFullYear()-((d.getMonth()<birthday.getMonth()|| d.getMonth()==birthday.getMonth() && d.getDate()<birthday.getDate())?1:0);
转载来的计算方法
var birthday=new Date("1989-06-25".replace(/-/g, "\/"));
var d=new Date();
var age = d.getFullYear()-birthday.getFullYear()-((d.getMonth()<birthday.getMonth()|| d.getMonth()==birthday.getMonth() && d.getDate()<birthday.getDate())?1:0);