Re: Script in SVG vs. HTML

On 3/10/09, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> Dailey, David P. wrote:
>
> > (1) In HTML (most browsers, at least) one can say
> >
> > var O=document.getElementsByTagName(sometag)
> > var q=O[i]
> >
> > whereas in SVG you have to do
> > var O=document.getElementsByTagName(sometag)
> > var q=O.items(i)
> >
>
>  Really?  I don't see SVG defining a getElementsByTagName function anywhere,
> so that's the DOM Core function you're using, and the DOM Core ECMAScript
> bindings require the [i] syntax to do the same thing as .item(i) (not
> .items(i)).  Am I missing something?  Was this just a matter of a buggy DOM
> implementation in some UA?
>

Yeah, pretty much.  Adobe's SVG Viewer (ASV) uses an old Mozilla
scripting engine that does not support the [] shortcut access on
DOMNodeLists, unfortunately.

Regards,
Jeff

Received on Tuesday, 10 March 2009 17:30:42 UTC