DOM replacement for innerHTML

Discussion in 'Javascript' started by Joe Kelsey, Aug 21, 2003.

  1. Joe Kelsey

    Joe Kelsey Guest

    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 DocumentFragment Node, something like
    document.parseHTML ("string"). Then you can take the DocumentFragment
    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
     
    Joe Kelsey, Aug 21, 2003
    #1
    1. Advertising

  2. Joe Kelsey

    Jim Ley Guest

    On 21 Aug 2003 15:48:52 -0700, (Joe
    Kelsey) wrote:

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


    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.

    > Is something like that in the works?


    in SVG 1.2 WD, the window interface has a parseXML method which
    returns a document or documentFragment. The CML DOM people have DOM
    3 Load & save http://www.w3.org/TR/DOM-Level-3-LS/load-save.html

    > Where would I look for
    >what the people involved have proposed?


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

    Jim.
    Jim.
    --
    comp.lang.javascript FAQ - http://jibbering.com/faq/
     
    Jim Ley, Aug 22, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. necromonger

    help with DOM row/cell with innerHTML

    necromonger, Oct 11, 2004, in forum: Javascript
    Replies:
    22
    Views:
    371
    Michael Winter
    Oct 14, 2004
  2. Jake Barnes
    Replies:
    2
    Views:
    138
    Jake Barnes
    Apr 7, 2006
  3. sonic
    Replies:
    5
    Views:
    315
    Randy Webb
    Jul 11, 2006
  4. Andrew Hedges
    Replies:
    3
    Views:
    134
    The Natural Philosopher
    Jul 5, 2007
  5. dan
    Replies:
    5
    Views:
    227
    David Mark
    Oct 28, 2007
Loading...

Share This Page