469,330 Members | 1,299 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

External Javascript works fine in Firefox, but breaks in IE

Hi, this is my first time posting a question, so I apologize if I goof up or do not provide enough information.

I am trying to implement a simple countdown script that I grabbed from Dynamic Drive. I'd try to build something myself, but I just need something quick and easy. The instructions say to put all the code on the same page; the functions in the <head> and then some code to call the countdown in the <body>.

In order to keep my main index page simple and uncluttered, I put the code they requested to have in the <head> into an external .js file and called it like you normally would: [HTML]<script type="text/javascript" src="includes/js/countdown.js"></script>[/HTML].

The countdown works fine in Firefox (and I'm assuming most gecko-based browsers, but I'm not 100% sure), but not in IE. IE is having trouble passing integers (I'm assuming) to and from the external file, because the countdown, where it would display numbers, is displaying NaN.

(Note: This script DOES work in IE when the code is in the <head> tag. But that's just stupid to have all that in there, especially for SEO purposes).

You can view the site I'm trying to do this on and check out the external javascript file.

I have tried looking through the code and seeing if there could be a place where a string is improperly being left as a string and not being interpreted as a number, but again, this code works in IE when it's not an external file. So I'm hoping someone could lead me in the right direction to get this problem solved :)

Thanks in advance.
Oct 25 '07 #1
5 3368
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

There seems to be an internal server error for the link that you've provided.
Oct 26 '07 #2
I apologize, I move the page and forgot to update it here!
Oct 26 '07 #3
acoder
16,027 Expert Mod 8TB
I think the problem is with the date string. You're using 24:00:00 for the time.
Oct 29 '07 #4
I think the problem is with the date string. You're using 24:00:00 for the time.
This was it! I was trying to say midnight, and for some reason, 24:00:00 came to mind, but changing it to 00:00:00 made it work!
Oct 30 '07 #5
acoder
16,027 Expert Mod 8TB
Glad you got it working. Post again if you have any more questions.
Oct 30 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by LRW | last post: by
5 posts views Thread by joaopedrogoncalves | last post: by
10 posts views Thread by andreister | last post: by
5 posts views Thread by steven.harms | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.