/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Javascript – Works in IE not Firefox

Hi All,

I am working on a script to load 1 of 24 images based on the date. The script works in IE, but in Firefox, only shows the last image in the string – wintersolstice.gif.

I am attaching the code in a .txt doc. Any insight as to why this is not working would be most appreciated.

psknight

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangFeb 25.2009 — getYear() returns a 2,3 or 4 digit number depending on the browser, use getFullYear()

You are comparing text values not numbers!
Copy linkTweet thisAlerts:
@psknightauthorFeb 25.2009 — Thanks, Fang! You're awesome. I guess it one of those can't see the trees for the forest. I am happy to report that it works in both now.?

psknight
×

Success!

Help @psknight spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...