DOM replacement for innerHTML

J

Joe Kelsey

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
 
J

Jim Ley

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top