W3C home > Mailing lists > Public > www-svg@w3.org > March 2009

Re: Script in SVG vs. HTML

From: Jeff Schiller <codedread@gmail.com>
Date: Tue, 10 Mar 2009 12:30:02 -0500
Message-ID: <da131fde0903101030s49441b8cp9eb8024416821df4@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "Dailey, David P." <david.dailey@sru.edu>, public-html@w3.org, www-svg <www-svg@w3.org>
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:43 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:41 GMT