Re: Element.createElement proposal

Zack Weinberg <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Johnny Stenback <[email protected]> wrote:
> >    var parent = document.getElementById("putsvghere"); // HTML elt
> >    var svg = parent.addChild('svg'); // HTML5 'svg' elt = SVG root
> > elt var circle = svg.addChild('circle', {...}); // SVG 'circle'
> 
> What should that code do if you replace parent.addChild('svg') with 
> parent.addChild('a')?

You get the HTML <a>.  Does it *ever* make sense to have <svg:a> (or
<svg:anythingelse>) a direct child of <html:whatever>, rather than with
a <svg:svg> in between?

> And does this always append, or insert at the 
> beginning, what if I want to insert somewhere in the middle etc etc?

I would expect "add" to mean appends, but I suppose you could have an
optional further argument which was either the element to insert after,
or magic constants for "at beginning"/"at end", like lseek().

zw
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.