I have a function here to swap images back and forth through an onClick event that works fine in a standard flat html file. However when I plop it into my jsp page, sometimes the images show, and sometimes they come up broken. Is this a simple preload issue or maybe more extensive? Here is the function and the implementaion….
<script language=”javascript”>
function chng(c_img, swap1, swap2) {
if (c_img.src.indexOf(swap1)!= -1) c_img.src = swap2;
else c_img.src = swap1;
}
</script>
<a href=”javascript:displaySwitching(‘courseOverview’);”><img src=”/educator_root/images/btns/btn_show-crse-details.gif” width=”131″ height=”23″ alt=”” border=”0″ onclick=”chng(this,’/educator_root/images/btns/btn_show-crse-details.gif’,’/educator_root/images/btns/btn_hide-crse-details.gif’)” name=”courseDetail” /></a>
[the href value is controlling a show/hide div layer down lower on the page]
thanks