PDA

View Full Version : jpegs on a website


JMCP
14th November 2003, 11:56
Hi,

at the very early stages of creating a website and I have a problem getting jpegs to display. I have had the jpegs in the same directory as the index page and now I have moved them into there own directory. Gifs are displaying fine but getting these jpegs to display is causing me to endless grief. Can anyone see anything wronmg with this code.

<HTML>
<BODY>
<SCRIPT LANGUAGE="JavaScript">

var num=1
var num2=2
var num3=3
img1 = new Image ()
img1.src = "images/snap1.jpg"
img2 = new Image ()
img2.src = "images/snap2.jpg"
img3 = new Image ()
img3.src = "images/snap3.jpg"
img4 = new Image ()
img4.src = "images/snap4.jpg"
img5 = new Image ()
img5.src = "images/snap5.jpg"
img6 = new Image ()
img6.src = "images/snap6.jpg"
img7 = new Image ()
img7.src = "images/snap7.jpg"
img8 = new Image ()
img8.src = "images/snap8.jpg"
img9 = new Image ()
img9.src = "images/snap9.jpg"
img10 = new Image ()
img10.src = "images/snap10.jpg"
img11 = new Image ()
img11.src = "images/snap11.jpg"
img12 = new Image ()
img12.src = "images/snap12.jpg"
img13 = new Image ()
img13.src = "images/snap13.jpg"
img14 = new Image ()
img14.src = "images/snap14.jpg"

function slideshowUp()
{
num=num+1
if (num==15)
{num=1}
num2=num2+1
if (num2==15)
{num2=1}
num3=num3+1
if (num3==15)
{num3=1}
document.mypic1.src=eval("img"+num+".src")
document.mypic2.src=eval("img"+num2+".src")
document.mypic3.src=eval("img"+num3+".src")

}

function slideshowBack()
{
num=num-1
if (num==0)
{num=14}
num2=num2-1
if (num2==0)
{num2=14}
num3=num3-1
if (num3==0)
{num3=14}
document.mypic1.src=eval("img"+num+".src")
document.mypic2.src=eval("img"+num2+".src")
document.mypic3.src=eval("img"+num3+".src")
}

</SCRIPT>

<!-- The Image and Form Codes are Below -->
<CENTER>
<IMG SRC ="banner3.gif" ALIGN="top"></A>
<p>

<CENTER>
<IMG SRC="images/snap1.jpg" NAME="mypic1" BORDER=1 HEIGHT="280" WIDTH="350">
<IMG SRC="images/snap2.jpg" NAME="mypic2" BORDER=1 HEIGHT="280" WIDTH="350">
<IMG SRC="images/snap3.jpg" NAME="mypic3" BORDER=1 HEIGHT="280" WIDTH="350">
</CENTER>
<p>


<A HREF="JavaScript:slideshowBack()"><IMG BORDER="0" SRC="button1.gif"></A>
<A HREF="JavaScript:slideshowUp()"><IMG BORDER="0" SRC="button2.gif"></A>
<p>
<CENTER>
<IMG SRC ="under_construction_bar.gif" ALIGN="bottom">
</CENTER>

<script language='javascript'>document.write('<img src="http://sitebuilder.freeserve.com/servlets/istat?site=clydeweddings&page=/index.html&outil=ftpweb&n=' + Math.round(Math.random()*100000) + '" width=1 height=1>'); </script>


</BODY>
</html>

PS. The webspace is free as part of my adsl connection with Freeserve, is it a possible restriction with their server software as this all displays fine when I use the browser to view it locally on my machine.

Cheers John

busbyvideo
14th November 2003, 13:11
Are your jpegs in a root directory called "images". Do you see placeholders for them? If you have moved them from their original place you will have to update the links.

------------------
Mike

JMCP
14th November 2003, 13:19
Hi Mike,

I have had the images in the same directory as the index page and just referenced the images by their jpg name ie <img src="snap1.jpg"> bu tthis didn't work so I made a directory called images and moved all the images in there and changed the img src to equal images/snap1.jpg, Ihave also tried ./images/snap1.jpg and many more combinations.

If I right click on the red cross on the website it does give me the correct path to the images. i truly am stumped as this should be very simple, at least it was in the past so, I must be doing something extremely stupid.

Cheers john

JMCP
14th November 2003, 15:09
Problem solved, I am a plonker. I was referencing the jpegs in lowercase when in fact the first character of the names of these jpegs were in uppercase.


Cheers John