PDA

View Full Version : Countdown clock - urgent!



rosepetal
02-19-2007, 03:51 AM
1) Script Title: Dynamic Countdown script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex6/dhtmlcount.htm


Basically, the code on my page works perfectly in Mozilla, but the numbers don't show up at all in explorer. See for yourself: http://advisenet.net/profile.htm

Does anyone know how to fix this?

codeexploiter
02-19-2007, 05:50 AM
The problem lies in the following line


var futuredate=new cdtime("countdowncontainer", "April 17, 2007 24:00:00")

If you create a date variable using Date object of JavaScript the date string format should match the parse() method of the Date object. Now if you put the following code in your script


var pRes = Date.parse("April 17, 2007 24:00:00");

In case of Mozilla Firefox the above code will work without any problem but in IE it will store NaN in variable pRes. This only happens if you provide 24:00:00 as the time string if you give any other time format it will work without problem.

In other words if you give this code


var futuredate=new cdtime("countdowncontainer", "April 17, 2007 24:00:00")

as this code


var futuredate=new cdtime("countdowncontainer", "April 17, 2007 23:59:59")

the script will work both in IE and Firefox

rosepetal
02-19-2007, 06:07 AM
Thank you so so much! The website had to be done by tomorrow, I didn't know what to do. And the code worked. Thanks :)

codeexploiter
02-19-2007, 06:35 AM
Thank you so so much! The website had to be done by tomorrow, I didn't know what to do. And the code worked. Thanks :)

Good to know that you've solved your problem :)