Click to See Complete Forum and Search --> : I need this little script to work with Netscape


Motabobo
05-09-2003, 06:38 PM
What should i do to make this work under Netscape ? (Netscape 6 & +, don't bother with 4)

Script :
function swapTree(menuDiv,fol)
{
window.focus();
d=eval("document.all."+menuDiv);
i=eval("document.all.img_"+menuDiv);
i1=eval("document.all.img_"+fol);
if (d.style.display=="none")
{
d.style.display="block";
i.src='../img/minus.gif';
i1.src='../img/foldero.gif';
}
else
{
d.style.display="none";
i.src='../img/plus.gif';
i1.src='../img/folder.gif';
}

}

Many thanks !!!

khalidali63
05-09-2003, 06:48 PM
document.getElementById

it works for both IE and NS

Motabobo
05-09-2003, 07:05 PM
Hi !

Thanks for your fast reply :D

Unfortunately, i don't know javascript at all ! (compared to ASP :rolleyes: )

Anyway, where should i put this ?

Instead of Document.all ?
Could you re-write the complete done script since it is that small please ?

Thanks

Motabobo
05-10-2003, 07:04 AM
Thanks a lot Dave, it now works even though there is a little bug :(

I'll try to fix that