Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > DOM replacement for innerHTML

Thread Tools

DOM replacement for innerHTML

Joe Kelsey
Posts: n/a
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?

Reply With Quote
Jim Ley
Posts: n/a
On 21 Aug 2003 15:48:52 -0700, Removed) (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

> Where would I look for
>what the people involved have proposed? of course where else?

comp.lang.javascript FAQ -

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
innerHTML works, but DOM doesn't - Please Help dan Javascript 5 10-28-2007 11:21 AM
The need for speed: innerHTML versus DOM manipulation Andrew Hedges Javascript 3 07-05-2007 09:52 AM
xhtml, innerHtml, appendChild, and innerHTML. what is the exact proper way to do this with DOM sonic Javascript 5 07-11-2006 08:17 AM
can't get the text from a div, neither when I try to use innerHTML or when I try to walk the DOM Jake Barnes Javascript 2 04-07-2006 02:42 AM
help with DOM row/cell with innerHTML necromonger Javascript 22 10-14-2004 09:31 AM