[thelist] Jscript vs. N4.7
Richard Bennett
richard.bennett at skynet.be
Tue Sep 4 07:32:35 CDT 2001
----- Original Message -----
> Hi all,
> Can anyone tell me why this here script doesn't work in dear old Netscape
> 4.7.
> document.images["flasher"].src = swopImg[image].src;
Hi,
Just in case you didn't know, although NS4 supports document.images[] , it
regards each <div> with an id, and it's position set, as a new document
nested inside the first.
So if your page looks like this:
<body>
<div id="holder">
<img id="flasher" name="flasher" src="blah.gif" />
</div>
</body>
Your script would look something like this:
if(document.layers){
document.holder.document.images["flasher"].src = swopImg[image].src
}else{
document.images["flasher"].src = swopImg[image].src
}
Also, the word "image" may well be a reserved word in NS4.
Cheers,
Richard Bennett
mail at richardinfo.com
www.richardinfo.com
More information about the thelist
mailing list