VBAPrincess
Programmer
I have a countdown script that I got from a book and it works great in IE. Firefox and Safari however do not. What do I need to do differently?
the code in the head section:
<script language="JavaScript">
<!-- hide script from old browsers
now = new Date
Uvote = new Date (now.getYear(), 2,5)
if (Uvote.getTime() < now.getTime()){
Uvote.setYear(Uvote.getYear()+1)
}
function dayToDays(inTime) {
return (Math.floor(inTime.getTime() / (1000 * 60 * 60 * 24)))
}
function daysTill(inDate) {
return dayToDays(inDate) - dayToDays(now)
}
// end hiding script from old browsers -->
</script>
The code in the body where the value goes:
<script language="JavaScript">
<!-- hide script from old browsers
document.write(daysTill(Uvote) + " DAYS UNTIL VOTE")
// end hiding script from old browsers -->
</script>
TIA for any and all help!!!
Diana
VBA Princess
-- I'm hoping to grow up to be a Goddess!
the code in the head section:
<script language="JavaScript">
<!-- hide script from old browsers
now = new Date
Uvote = new Date (now.getYear(), 2,5)
if (Uvote.getTime() < now.getTime()){
Uvote.setYear(Uvote.getYear()+1)
}
function dayToDays(inTime) {
return (Math.floor(inTime.getTime() / (1000 * 60 * 60 * 24)))
}
function daysTill(inDate) {
return dayToDays(inDate) - dayToDays(now)
}
// end hiding script from old browsers -->
</script>
The code in the body where the value goes:
<script language="JavaScript">
<!-- hide script from old browsers
document.write(daysTill(Uvote) + " DAYS UNTIL VOTE")
// end hiding script from old browsers -->
</script>
TIA for any and all help!!!
Diana
VBA Princess
-- I'm hoping to grow up to be a Goddess!