<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: DOMDom: More DOM, Less DOM</title>
	<atom:link href="http://ajaxian.com/archives/domdom-more-dom-less-dom/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/domdom-more-dom-less-dom</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: Andi</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252711</link>
		<dc:creator>Andi</dc:creator>
		<pubDate>Sun, 15 Jul 2007 22:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252711</guid>
		<description>PS: Prototype still has no DOM builder, has it? So what about:

$C = function(string) {
	var D = document.createElement(&#039;div&#039;);
	try { D.innerHTML = string; } catch(e) {}
	if (D.hasChildNodes())
		return D.childNodes.length == 1 ? D.firstChild : D.childNodes;
	return null;
};</description>
		<content:encoded><![CDATA[<p>PS: Prototype still has no DOM builder, has it? So what about:</p>
<p>$C = function(string) {<br />
	var D = document.createElement(&#8216;div&#8217;);<br />
	try { D.innerHTML = string; } catch(e) {}<br />
	if (D.hasChildNodes())<br />
		return D.childNodes.length == 1 ? D.firstChild : D.childNodes;<br />
	return null;<br />
};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andi</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252671</link>
		<dc:creator>Andi</dc:creator>
		<pubDate>Fri, 13 Jul 2007 12:58:36 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252671</guid>
		<description>The syntax of DOMdom doesn&#039;t look very logically, jQuerys DOM builder looks the best.

I personally prefer innerHTML - PPK&#039;s test case shows why. I think it&#039;s quicker because internal DOM building on very low level is used implicitly to build the DOM instead of explicit JavaScript methods. If your code MAY not be valid simply use try .. catch.

Quote from http://www.quirksmode.org/dom/innerhtml.html:
&lt;blockquote cite=&quot;PPK&quot;&gt;The most obvious conclusion of these tests is that innerHTML is faster than &quot;real&quot; W3C DOM methods in all browsers. The W3C DOM table methods are slow to very slow, especially in Explorer.&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>The syntax of DOMdom doesn&#8217;t look very logically, jQuerys DOM builder looks the best.</p>
<p>I personally prefer innerHTML &#8211; PPK&#8217;s test case shows why. I think it&#8217;s quicker because internal DOM building on very low level is used implicitly to build the DOM instead of explicit JavaScript methods. If your code MAY not be valid simply use try .. catch.</p>
<p>Quote from <a href="http://www.quirksmode.org/dom/innerhtml.html" rel="nofollow">http://www.quirksmode.org/dom/innerhtml.html</a>:</p>
<blockquote cite="PPK"><p>The most obvious conclusion of these tests is that innerHTML is faster than &#8220;real&#8221; W3C DOM methods in all browsers. The W3C DOM table methods are slow to very slow, especially in Explorer.</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Kidder</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252646</link>
		<dc:creator>Mike Kidder</dc:creator>
		<pubDate>Thu, 12 Jul 2007 23:31:29 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252646</guid>
		<description>sorry, Jack wins!</description>
		<content:encoded><![CDATA[<p>sorry, Jack wins!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerome</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252641</link>
		<dc:creator>Jerome</dc:creator>
		<pubDate>Thu, 12 Jul 2007 21:54:31 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252641</guid>
		<description>@Carmen: &quot;id like to see more DOM creation benchmarking&quot;

It would be good to see more benchmarks but I trust the quirksmode results enough to think that other tests aren&#039;t going to produce results that are significantly different. Or at least not different enough in IE (who doesn&#039;t love Firefox but there&#039;s no getting away from the fact that it&#039;s dominant) to make DOM object creation viable, if you care about speed of execution.

I dunno, maybe I&#039;ve got optimisation OCD. I&#039;ll shut up now, I promise.</description>
		<content:encoded><![CDATA[<p>@Carmen: &#8220;id like to see more DOM creation benchmarking&#8221;</p>
<p>It would be good to see more benchmarks but I trust the quirksmode results enough to think that other tests aren&#8217;t going to produce results that are significantly different. Or at least not different enough in IE (who doesn&#8217;t love Firefox but there&#8217;s no getting away from the fact that it&#8217;s dominant) to make DOM object creation viable, if you care about speed of execution.</p>
<p>I dunno, maybe I&#8217;ve got optimisation OCD. I&#8217;ll shut up now, I promise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack Slocum</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252639</link>
		<dc:creator>Jack Slocum</dc:creator>
		<pubDate>Thu, 12 Jul 2007 21:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252639</guid>
		<description>That&#039;s the &quot;verbose&quot; DomHelper syntax. It could be shortened to:

&lt;code&gt;Ext.DomHelper.append( myDiv, {
   style: &#039;width:100%;border:1px solid blue;&#039;,
   cls: &#039;testClass&#039;,
   cn: {tag: &#039;a&#039;, href: &#039;http://www.google.com/&#039;, 
       cn: {tag: &#039;span&#039;, html: &#039;Google&#039; }
   }
});&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>That&#8217;s the &#8220;verbose&#8221; DomHelper syntax. It could be shortened to:</p>
<p><code>Ext.DomHelper.append( myDiv, {<br />
   style: 'width:100%;border:1px solid blue;',<br />
   cls: 'testClass',<br />
   cn: {tag: 'a', href: '<a href="http://www.google.com/&#039;" rel="nofollow">http://www.google.com/&#039;</a>,<br />
       cn: {tag: 'span', html: 'Google' }<br />
   }<br />
});</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carmen</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252637</link>
		<dc:creator>carmen</dc:creator>
		<pubDate>Thu, 12 Jul 2007 20:31:41 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252637</guid>
		<description>wheres the inefficiency? i havent tried this one, but DOM creation is plenty fast here with jquery/firefox and a 10 line dom+events-creation plugin..

well if 90 ms is fast. id like to see more DOM creation benchmarking - now that selector-speed has been done to death</description>
		<content:encoded><![CDATA[<p>wheres the inefficiency? i havent tried this one, but DOM creation is plenty fast here with jquery/firefox and a 10 line dom+events-creation plugin..</p>
<p>well if 90 ms is fast. id like to see more DOM creation benchmarking &#8211; now that selector-speed has been done to death</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerome</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252636</link>
		<dc:creator>Jerome</dc:creator>
		<pubDate>Thu, 12 Jul 2007 19:47:52 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252636</guid>
		<description>I appreciate the structure it provides but I can&#039;t get over the terrible inefficiency. I say potato, you say an edible starchy tuber of the nightshade family.

Ooh, and string concatenation can be quite nice with a C# style StringBuilder function based on array push and join.

And another thing, blah blah blah...

There&#039;s just no shutting up us whiners :)</description>
		<content:encoded><![CDATA[<p>I appreciate the structure it provides but I can&#8217;t get over the terrible inefficiency. I say potato, you say an edible starchy tuber of the nightshade family.</p>
<p>Ooh, and string concatenation can be quite nice with a C# style StringBuilder function based on array push and join.</p>
<p>And another thing, blah blah blah&#8230;</p>
<p>There&#8217;s just no shutting up us whiners :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cdude</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252629</link>
		<dc:creator>cdude</dc:creator>
		<pubDate>Thu, 12 Jul 2007 17:17:39 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252629</guid>
		<description>The examples should show the attaching of event handlers to the dom nodes as they&#039;re built. That would be more usefull and should shut the innerHTML whiners up. I don&#039;t know about you guys but when I&#039;m adding elements dynamically to the DOM, i&#039;m usually gonna need to attach some event handlers. Plus, no string concatenation everywhere with innerHTML. Sounds to me like the innerHTML supporters are people that would get a chunk of HTML from an &quot;ajax&quot; request and just throw it in some container div.</description>
		<content:encoded><![CDATA[<p>The examples should show the attaching of event handlers to the dom nodes as they&#8217;re built. That would be more usefull and should shut the innerHTML whiners up. I don&#8217;t know about you guys but when I&#8217;m adding elements dynamically to the DOM, i&#8217;m usually gonna need to attach some event handlers. Plus, no string concatenation everywhere with innerHTML. Sounds to me like the innerHTML supporters are people that would get a chunk of HTML from an &#8220;ajax&#8221; request and just throw it in some container div.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scriptor</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252624</link>
		<dc:creator>Scriptor</dc:creator>
		<pubDate>Thu, 12 Jul 2007 15:41:11 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252624</guid>
		<description>I&#039;ll use innerHTML any day, but if I had to choose from the above, I&#039;d say jQuery&#039;s version is more readable.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll use innerHTML any day, but if I had to choose from the above, I&#8217;d say jQuery&#8217;s version is more readable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252623</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Thu, 12 Jul 2007 15:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252623</guid>
		<description>DOMDom uses innerHTML by default, and can be switched over to DOM methods with the switch of a boolean.

It sounds like the argument being made here is that no one should use a DOM creation class at all, and we should just be sticking with raw innerHTML all the time.  That&#039;s fine by me, if you prefer it.

But the entire point of this class is to give you the option to use a shorthand method that most of us already know with the CSS query syntax already in most libraries today.</description>
		<content:encoded><![CDATA[<p>DOMDom uses innerHTML by default, and can be switched over to DOM methods with the switch of a boolean.</p>
<p>It sounds like the argument being made here is that no one should use a DOM creation class at all, and we should just be sticking with raw innerHTML all the time.  That&#8217;s fine by me, if you prefer it.</p>
<p>But the entire point of this class is to give you the option to use a shorthand method that most of us already know with the CSS query syntax already in most libraries today.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JDP</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252622</link>
		<dc:creator>JDP</dc:creator>
		<pubDate>Thu, 12 Jul 2007 15:21:03 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252622</guid>
		<description>Experimentation is good, but this seems to be too far afield from setting attributes programmatically (like Ext), and equally far afield from the ease of using innerHTML. Not really a niche that needs to be filled.</description>
		<content:encoded><![CDATA[<p>Experimentation is good, but this seems to be too far afield from setting attributes programmatically (like Ext), and equally far afield from the ease of using innerHTML. Not really a niche that needs to be filled.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gonchuki</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252620</link>
		<dc:creator>gonchuki</dc:creator>
		<pubDate>Thu, 12 Jul 2007 15:06:01 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252620</guid>
		<description>innerHTML will be faster *until* browser developers give proper optimization to the DOM functions... it&#039;s nonsense that directly creating the nodes is actually slower than giving potential tag soup that must be parsed and checked for sanity *before* creating the corresponding nodes.</description>
		<content:encoded><![CDATA[<p>innerHTML will be faster *until* browser developers give proper optimization to the DOM functions&#8230; it&#8217;s nonsense that directly creating the nodes is actually slower than giving potential tag soup that must be parsed and checked for sanity *before* creating the corresponding nodes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252616</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Thu, 12 Jul 2007 13:14:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252616</guid>
		<description>innerHTML is faster than standard dom anyday...
this is stupid, straight up. For all this hassle you might as well use innerHTML.</description>
		<content:encoded><![CDATA[<p>innerHTML is faster than standard dom anyday&#8230;<br />
this is stupid, straight up. For all this hassle you might as well use innerHTML.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerome</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252611</link>
		<dc:creator>Jerome</dc:creator>
		<pubDate>Thu, 12 Jul 2007 11:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252611</guid>
		<description>Erm, sorry for sounding horribly strident. I&#039;ve just finished my third cup of coffee and I&#039;m feeling a bit wired.

Still, FWIW I stand by the logic of what I said, if not the tone :)</description>
		<content:encoded><![CDATA[<p>Erm, sorry for sounding horribly strident. I&#8217;ve just finished my third cup of coffee and I&#8217;m feeling a bit wired.</p>
<p>Still, FWIW I stand by the logic of what I said, if not the tone :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerome</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252610</link>
		<dc:creator>Jerome</dc:creator>
		<pubDate>Thu, 12 Jul 2007 11:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252610</guid>
		<description>So the argument is that innerHTML isn&#039;t a W3C standard, but if all the browsers you care about support it, why is that a problem? For me, PPK&#039;s test results say it all when it comes to deciding whether to use convoluted parsing and object creation vs innerHTML.

http://www.quirksmode.org/dom/innerhtml.html

Why reinvent the wheel and make it square, unlesss you&#039;re driven by standards OCD?</description>
		<content:encoded><![CDATA[<p>So the argument is that innerHTML isn&#8217;t a W3C standard, but if all the browsers you care about support it, why is that a problem? For me, PPK&#8217;s test results say it all when it comes to deciding whether to use convoluted parsing and object creation vs innerHTML.</p>
<p><a href="http://www.quirksmode.org/dom/innerhtml.html" rel="nofollow">http://www.quirksmode.org/dom/innerhtml.html</a></p>
<p>Why reinvent the wheel and make it square, unlesss you&#8217;re driven by standards OCD?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DeadCabbit</title>
		<link>http://ajaxian.com/archives/domdom-more-dom-less-dom/comment-page-1#comment-252607</link>
		<dc:creator>DeadCabbit</dc:creator>
		<pubDate>Thu, 12 Jul 2007 10:28:07 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2567#comment-252607</guid>
		<description>Domhelper is pretty readable, but why not pass an html string and parse it? Actually innerHTML injects are pretty slow in IE, but apart form that I do not find it *that* dirty... do I miss something here?</description>
		<content:encoded><![CDATA[<p>Domhelper is pretty readable, but why not pass an html string and parse it? Actually innerHTML injects are pretty slow in IE, but apart form that I do not find it *that* dirty&#8230; do I miss something here?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

