所以我有这段代码:
<?php $today = date('Y-m-d'); ?>
<script>
function maggiorenne () {
//get today's date
today = "<?=$today ?>";
today = dateToTimestamp(today);
console.log(today);
// get birth date
birthdate = $("#datepickernascita").val();
// console.log(birthdate);
birthdate=dateToTimestamp(birthdate);
//check if the user is 18 or less
age=today-birthdate
document.getElementById('minorenne').style.display='none';
if(age < 567648000000){
document.getElementById('minorenne').style.display='block';
}
};
</script>
加上这个:
<input type="text" id="datepickernascita" name="datepickernascita" class="validate[required,custom[date]]" onblur="maggiorenne()"/>
我已经完成了很多互联网搜索,但我无法理解它为什么只使用Chrome而不是其他浏览器。如何解决这个问题?