PDA

View Full Version : random image in javascript problem



firstborn01
June 13th, 2004, 09:38 PM
before i ask this question i would like to preface it by saying that i can't use php because doteasy's $0 web hosting doesn't support it unless you pay them extra money (which i don't have)

so here we go...

in the header to my website i have a picture that is loaded at random every time the site is loaded. i would like to have it load only once and be the same throughout the many pages of my site but as far as i know, that is only possible with php. so i found a javascript code that will load a different picture everytime the page is loaded. it works fine but every once in awhile i get "undefined" where the picture should be. i checked all of my numbers and image names and everything but i can't get it to go away. as of now, only the main page has the random images.

so what should i do?

my site is at www.davekoen.com/version2 for now. when i get this working i am going to switch it to my main page.

thanks for your help.

dave

firstborn01
June 14th, 2004, 07:24 PM
i may have solved it... but i am not sure.... would starting with the number 1 in my array instead of 0 cause the aformentioned effect?