I downloaded the code and started a fresh test page (XHTML trans)
so it’s exactly like the example
I know the file paths are fine because I’ve swapped blank.jpg to make sure.
The javascript is just not giving me any action, but everybody else’s seems fine
… is it the page set up?, er… I really can’t think what…
all the images are the same size…
anyway here’s the code, in all it’s glory
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “
<html xmlns=”
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″ />
<title>Image Viewer Test</title>
<script language=”javascript”>
function changeImage(filename) {
mainimage.src = filename;
}
</script>
</head>
<body>
<p>
<a href=”javascript:changeImage(‘imageviewer/one.jpg’)”>Image 1</a>
<a href=”javascript:changeImage(‘imageviewer/two.jpg’)”>Image 2</a>
<a href=”javascript:changeImage(‘imageviewer/three.jpg’)”>Image 3</a>
<a href=”javascript:changeImage(‘imageviewer/four.jpg’)”>Image 4</a>
</p>
<p>
<img src=”imageviewer/blank.jpg” id=”mainimage” />
</p>
</body>
</html>