DOM replacement for innerHTML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe Kelsey

    #1

    DOM replacement for innerHTML

    Does the DOM allow for anything that takes the place of innerHTML?

    That particular "feature" seems to have an extremely awkward
    interface, not really very well thought out. I thought that maybe
    something related to ranges might have something to say about it, but
    I can't find anything in the standards docs.

    What *I* think the DOM needs is a Document method that accepts a
    string and produces a DocumentFragmen t Node, something like
    document.parseH TML ("string"). Then you can take the DocumentFragmen t
    node and insert it whereever you think it belongs. This whole
    business of assigning to innerHTML and magically replacing whole
    document subtrees just seems like too much magic.

    Obviously, we need something which accepts HTML or XML and produces a
    valid subtree which you can insert into the document in a controlled
    manner. Is something like that in the works? Where would I look for
    what the people involved have proposed?

    /Joe
  • Jim Ley

    #2
    Re: DOM replacement for innerHTML

    On 21 Aug 2003 15:48:52 -0700, joe-gg@zircon.seatt le.wa.us (Joe
    Kelsey) wrote:
    [color=blue]
    >Does the DOM allow for anything that takes the place of innerHTML?[/color]

    only incredibly kludgey systems which run incredibly slowly and take
    up hundreds of lines of code. A better idea is to keep content in
    HTML, and not to bury content (the HTML) in your script at all. just
    move HTML around, that way you avoid having to do either.
    [color=blue]
    > Is something like that in the works?[/color]

    in SVG 1.2 WD, the window interface has a parseXML method which
    returns a document or documentFragmen t. The CML DOM people have DOM
    3 Load & save http://www.w3.org/TR/DOM-Level-3-LS/load-save.html
    [color=blue]
    > Where would I look for
    >what the people involved have proposed?[/color]

    http://www.w3.org/ of course where else?

    Jim.
    Jim.
    --
    comp.lang.javas cript FAQ - http://jibbering.com/faq/

    Comment

    Working...