Forum Moderators: open
<head>
<script type="text/javascript">
function update(series){
document.images['gimg'].src = "file:///C:/aaa-temp/best" + series + ".jpg";
}
</script>
</head><body>
<img id="gimg" src="file:///C:/aaa-temp/best1.jpg" width="510" height="300" >
<div id="desc">
<a href="#" onclick="update('1')" >1: picture 1 text</a>
<a href="#" onclick="update('2')" >2: picture 2 text</a>
</div>
</body>
I put some alert boxes in the function, entered the page, and then clicked on the second reference. The image switched to best2.jpg, and then switched back to best1.jpg.
Any idea what I may have done wrong here?
Thanks Jim
document.getElementById('gimg').src = "file:///C:/aaa-temp/best" + series + ".jpg";
Also, wouldn't hurt to add a return false to your links;
<a href="#" onclick="update('1'); return false;" >1: picture 1 text</a>
<a href="#" onclick="update('2'); return false;" >2: picture 2 text</a>