Help - Search - Members - Calendar
Full Version: Javascript Doesn't Work Online?
Zymic Webmaster Forums > Web Design & Development > Client Side Scripting > JavaScript
Linda.
I am working on a site and I wanted to share it with a friend, so I uploaded it to my uuuq.com-space temporary. In my site I had an JavaScript for photo's: It makes that every thime I open the site, a new photo appears. On my computer it worked well, but now it's online it doesn't work anymore. Is there something wrong in my script or is it not allowed? I get the same error in Internet Explorer and Firefox.

The link is: http://lifebylinda.uuuq.com/Santarem/index.htm
Andrew
http://lifebylinda.uuuq.com/Santarem/images/slide/1.jpg doesn't exist, but
http://lifebylinda.uuuq.com/Santarem/Images/Slide/1.jpg DOES.

Capital letters make a difference on linux servers. Edit the javascript to look for /Images/Slide/#.jpg (for all 7 images) and just replace # with the right number.

your script will look like this:
CODE
                   <script LANGUAGE="Javascript">
                function banner() { }; b = new banner(); n = 0
                b[n++]= "<IMG name=randimg SRC='Images/Slide/1.jpg' border='0' ALT=''>"
                b[n++]= "<IMG name=randimg SRC='Images/Slide/2.jpg' border='0' ALT=''>"
                b[n++]= "<IMG name=randimg SRC='Images/Slide/3.jpg' border='0' ALT=''>"
                b[n++]= "<IMG name=randimg SRC='Images/Slide/4.jpg' border='0' ALT=''>"
                b[n++]= "<IMG name=randimg SRC='Images/Slide/5.jpg' border='0' ALT=''>"
                b[n++]= "<IMG name=randimg SRC='Images/Slide/6.jpg' border='0' ALT=''>"
                b[n++]= "<IMG name=randimg SRC='Images/Slide/7.jpg' border='0' ALT=''>"
                i=Math.floor(Math.random() * n);
                document.write( b[i] )
                </SCRIPT>
Linda.
Thnx a lot! I thought there was something wrong with the script because it did work on my computer!

So easy, now that I know wink.gif
Andrew
Glad I could help, it's kind of frustrating sometimes when filenames are case sensitive, but other times can actually be quite useful.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.