Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

DOM replacement for innerHTML

 
 
Joe Kelsey
Guest
Posts: n/a
 
      08-21-2003
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
 
Reply With Quote
 
 
 
 
Jim Ley
Guest
Posts: n/a
 
      08-21-2003
On 21 Aug 2003 15:48:52 -0700, http://www.velocityreviews.com/forums/(E-Mail 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 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/

 
Reply With Quote
 
 
 
Reply

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



Advertisments