Results 1 to 4 of 4

Thread: Countdown clock - urgent!

  1. #1
    Join Date
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Countdown clock - urgent!

    1) Script Title: Dynamic Countdown script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...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?

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    The problem lies in the following line

    Code:
    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

    Code:
    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

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

    Code:
    var futuredate=new cdtime("countdowncontainer", "April 17, 2007 23:59:59")
    the script will work both in IE and Firefox

  3. #3
    Join Date
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    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

  4. #4
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Quote Originally Posted by rosepetal View Post
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •