[Javascript] changing image src

Marcelo Simon grillo at lazzuri.com.br
Fri Jun 20 09:32:12 CDT 2003


Hi all,

Please help me on this:

I have a menu on my page with 3 images, on click I want them to change it's
src attribute and load 4 diferent pages on 4 diferente frames, so I've
created this function here:

function midiaext(){
 parent.img.location.href='04_midiaext/04_00_img.htm';
 parent.txt.location.href='04_midiaext/04_txt.htm';
 parent.tit.location.href='04_midiaext/04_tit.htm';
 parent.nota.location.href='04_midiaext/04_00_nota.htm'
 document.bt_02.src = '_img/bt_02radio_off.gif';
 document.bt_03.src = '_img/bt_03internet_off.gif';
 document.bt_04.src = '_img/bt_04midiaext_on.gif';
}

it is changing the pages, but it isn't changing the image src. I'd added an
alert(document.bt_04.src); that is showing me the image name so I'm 100%
sure that the DOM is correct, this is my button

 <td><a href="#" onClick="midiaext(); return true;"><img src="_img/nada.gif"
name="bt_04" width="143" height="33" border="0"
onMouseOver="MM_swapImage('bt_04','','_img/bt_04midiaext_on.gif',1)"
onMouseOut="MM_swapImgRestore()"></a></td>

Please advice, this website is due today, and this is the last quirk to
resolve.

Thanks in advance
Marcelo Simon




More information about the Javascript mailing list