But for some odd reason now, it doesn't. Does anybody know why this is? I'm not sure exactly when it stopped working, I just noticed it when I set out to make a little counter script.
Thanks,
-PG
__________________ Check out my Please login or register to view this content. Registration is FREE or my Please login or register to view this content. Registration is FREE !
That could be it, but I don't think so. I just remember having this code in one of my previous projects, and it worked fine.
__________________ Check out my Please login or register to view this content. Registration is FREE or my Please login or register to view this content. Registration is FREE !
I tried something else, and I found out that if you put the JS code inside an external .js file, and link to it with <script src="..."></script>, it works just fine.
No errors on that, either.
EDIT: Now the example I used above is working fine in FF. It changed overnight?
__________________ Check out my Please login or register to view this content. Registration is FREE or my Please login or register to view this content. Registration is FREE !
Last edited by Physicsguy; 08-05-2011 at 02:08 PM..
No, I have Web Developer tools, and have cache disabled on every website I've ever been to. I even tried a hard refresh (Ctrl-F5), and that did nothing.
Although it works now so I guess this thread is sort of useless unless (:O) somebody else has a similar issue...
__________________ Check out my Please login or register to view this content. Registration is FREE or my Please login or register to view this content. Registration is FREE !
My thought is since the original code was not in the head that the following happened:
1. The page loads and causes the onload event to fire prior to reaching your JS code.
2. Your JS code loads
3. Your JS code doesn't run since the onload event has already fired which also means no errors.
4. Now that you have your code in an external file, the onload event gets bound and will fire when the page loads (since the reference is in the head tag).
There is no languange attribute for the script element.
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
No guys, the problem is solved. It turns out that I needed to call the JS AFTER the div call, so the div would be initialized before the JS.
__________________ Check out my Please login or register to view this content. Registration is FREE or my Please login or register to view this content. Registration is FREE !
the script must be placed between <head> </head> tag
and div between <body></body> tag
Now had you read the post before yours you would KNOW that your suggestion would NOT work at all.
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?