Re: Why not Node.insertAfter()?

keshlam@us.ibm.com wrote:

> node.insertAfter(newKid,refChild), if it existed, would be precisely
> equivalent to node.insertBefore(newKid,refChild.getNextSibling()).

So I guess I should interpret getNextSibling() as the next node at the
same level as the refChild? I thought sibling was a node with the same
tagname sort of like my lastname <richardson> which would be the same
for my siblings.

>
>
> Note that inserting before null means inserting at the end of the list, so
> the Right Thing should happen even in that case.  Also note that a
> shorthand in that case is node.appendChild(newKid).

So this means insert at the end based on the node's context.

These are obviously errant thoughts of a DOM mortal, based
on the english language, not the spec. I think I got it unless I said
something really wrong.

Thanks for the help,
Eric

>
>
> So insertAfter might be convenient, but isn't strictly necessary. Which is
> why we left it out of Level 1.
> ______________________________________
> Joe Kesselman  / IBM Research

Received on Wednesday, 8 March 2000 13:36:21 UTC