[Javascript] RE: function not defined only in Netscape 6
Hassan Schroeder
hassan at webtuitive.com
Mon Aug 19 12:27:57 CDT 2002
Miss Amy wrote:
> You can see the script in action at this link. If you view it with
> IE or NN4, it works perfectly. But if you view it with NN6, nothing.
>
> http://faculty1.coloradocollege.edu/~apacheco/math/Faculty/welcome.html
if(!document.all && document.getElementById)
{
//thisbrowser="NN6";
document.getElementByName("FacImage").src=personimage[personNum].src;
document.getElementByName("FacInfo").value=persontext[personNum];
}
... because there *is* no function getElementByName() -- there's
a getElementsByName() [ Element*s* plural ] that returns an array --
but the appropriate function to use here is getElementById.
FWIW!
--
H*
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
-- creating dynamic Web sites and applications since 1994 --
More information about the Javascript
mailing list