<?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: Do not use the innerHTML property on HTML objects</title>
	<atom:link href="http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/</link>
	<description>Advanced katas for javascripters</description>
	<lastBuildDate>Fri, 30 Jul 2010 18:10:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: kamal</title>
		<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/comment-page-1/#comment-731</link>
		<dc:creator>kamal</dc:creator>
		<pubDate>Tue, 31 Mar 2009 13:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=26#comment-731</guid>
		<description>can we create a java script function which is used to convert a html string into complete DOM object. for example


  
</description>
		<content:encoded><![CDATA[<p>can we create a java script function which is used to convert a html string into complete DOM object. for example</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hostile Fork</title>
		<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/comment-page-1/#comment-564</link>
		<dc:creator>Hostile Fork</dc:creator>
		<pubDate>Mon, 25 Aug 2008 06:47:02 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=26#comment-564</guid>
		<description>Wanted to point something out that I discovered, which is that Mozilla explicitly says you can&#039;t use innerHTML when building tables.  When I tried to use it to do so, it completely ignored various attributes, like... say... &quot;colspan&quot;.  Was quite perplexing to me in debugging a dynamically generated table, then I found this:

http://developer.mozilla.org/En/DOM:element.innerHTML

&quot;It should never be used to write parts of a table--W3C DOM methods should be used for that—-though it can be used to write an entire table or the contents of a cell.&quot;

Not one of mankind&#039;s prouder moments in API design.  And it certainly doesn&#039;t inspire confidence that other uses are going to be bug free (is it really only tables that are broken?)  In any case, I only changed that bit... using innerHTML in all non-table contexts and DOM for tables.  We&#039;ll see, but maybe I will end up taking your advice in the end.  :(  

That aside, I think you should reconsider your stance on JavaScript&#039;s two delimeters for strings.  It&#039;s a language feature and might as well use it...any complaints about the lack of beauty of there not being a single &quot;canonical required form&quot; I won&#039;t believe because, er, you&#039;re programming in JavaScript.  It&#039;s already la la land!  Why make it uglier than it already is?</description>
		<content:encoded><![CDATA[<p>Wanted to point something out that I discovered, which is that Mozilla explicitly says you can&#8217;t use innerHTML when building tables.  When I tried to use it to do so, it completely ignored various attributes, like&#8230; say&#8230; &#8220;colspan&#8221;.  Was quite perplexing to me in debugging a dynamically generated table, then I found this:</p>
<p><a href="http://developer.mozilla.org/En/DOM:element.innerHTML" rel="nofollow">http://developer.mozilla.org/En/DOM:element.innerHTML</a></p>
<p>&#8220;It should never be used to write parts of a table&#8211;W3C DOM methods should be used for that—-though it can be used to write an entire table or the contents of a cell.&#8221;</p>
<p>Not one of mankind&#8217;s prouder moments in API design.  And it certainly doesn&#8217;t inspire confidence that other uses are going to be bug free (is it really only tables that are broken?)  In any case, I only changed that bit&#8230; using innerHTML in all non-table contexts and DOM for tables.  We&#8217;ll see, but maybe I will end up taking your advice in the end.  <img src='http://www.javascriptkata.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   </p>
<p>That aside, I think you should reconsider your stance on JavaScript&#8217;s two delimeters for strings.  It&#8217;s a language feature and might as well use it&#8230;any complaints about the lack of beauty of there not being a single &#8220;canonical required form&#8221; I won&#8217;t believe because, er, you&#8217;re programming in JavaScript.  It&#8217;s already la la land!  Why make it uglier than it already is?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rook2pawn</title>
		<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/comment-page-1/#comment-551</link>
		<dc:creator>rook2pawn</dc:creator>
		<pubDate>Fri, 18 Jul 2008 17:08:08 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=26#comment-551</guid>
		<description>Thank you for this article. I will be sending all my ajax data in JSON from now on. I agree with you completely. Guys, the quirksmode DOM vs InnerHTML simply shows that custom non-standard methods of COURSE will be faster, but misses the point ENTIRELY of what the internet&#039;s REST principles : Proponents of REST argue that the Web&#039;s scalability and growth are a direct result of a few key design principles: 
[snippet]
All resources share a uniform interface for the transfer of state between client and resource, consisting of 

A constrained set of well-defined operations

A constrained set of content types, optionally supporting code on demand</description>
		<content:encoded><![CDATA[<p>Thank you for this article. I will be sending all my ajax data in JSON from now on. I agree with you completely. Guys, the quirksmode DOM vs InnerHTML simply shows that custom non-standard methods of COURSE will be faster, but misses the point ENTIRELY of what the internet&#8217;s REST principles : Proponents of REST argue that the Web&#8217;s scalability and growth are a direct result of a few key design principles:<br />
[snippet]<br />
All resources share a uniform interface for the transfer of state between client and resource, consisting of </p>
<p>A constrained set of well-defined operations</p>
<p>A constrained set of content types, optionally supporting code on demand</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miguel Garz</title>
		<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/comment-page-1/#comment-407</link>
		<dc:creator>Miguel Garz</dc:creator>
		<pubDate>Tue, 15 Jan 2008 16:20:18 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=26#comment-407</guid>
		<description>Good morning.
I liked a lot this article. AS a Java programmer and OO analyst is seems much clear the idea to use the DOM objects, that are in the end implemented by the browser.
Of course if speed is the matter I believe that it can be used in simple cases. However the OO aproach that the DOM objects provides higher decoupling and phisical abstraction.</description>
		<content:encoded><![CDATA[<p>Good morning.<br />
I liked a lot this article. AS a Java programmer and OO analyst is seems much clear the idea to use the DOM objects, that are in the end implemented by the browser.<br />
Of course if speed is the matter I believe that it can be used in simple cases. However the OO aproach that the DOM objects provides higher decoupling and phisical abstraction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: benmullin333</title>
		<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/comment-page-1/#comment-130</link>
		<dc:creator>benmullin333</dc:creator>
		<pubDate>Thu, 18 Oct 2007 22:25:58 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=26#comment-130</guid>
		<description>Dan--

I&#039;m glad I found your article.  innerHTML was RE-WRITTING my anchor tag.  I don&#039;t know why or WTF, but

foo.innerHTML(&quot;[carrot here]a href=\&quot;javascript:callFoo(&quot; + Bar1 + &quot;, &quot; + Bar2 + &quot;);&gt;&quot;)

would come out as  [carrot here]a Bar1=&quot;&quot; , =&quot;&quot; Bar2);=&quot; href=&quot;javascrip....

This helped me figure out how to get it to work.</description>
		<content:encoded><![CDATA[<p>Dan&#8211;</p>
<p>I&#8217;m glad I found your article.  innerHTML was RE-WRITTING my anchor tag.  I don&#8217;t know why or WTF, but</p>
<p>foo.innerHTML(&#8220;[carrot here]a href=\&#8221;javascript:callFoo(&#8221; + Bar1 + &#8220;, &#8221; + Bar2 + &#8220;);&gt;&#8221;)</p>
<p>would come out as  [carrot here]a Bar1=&#8221;" , =&#8221;" Bar2);=&#8221; href=&#8221;javascrip&#8230;.</p>
<p>This helped me figure out how to get it to work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Travis Hawkins</title>
		<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/comment-page-1/#comment-131</link>
		<dc:creator>Travis Hawkins</dc:creator>
		<pubDate>Thu, 30 Aug 2007 19:15:11 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=26#comment-131</guid>
		<description>Stand Proud Bro,

I agree with this article completely. innerHTML is going to be the death of us all as it represents a dirty little break from standards that proves to the browser designers that none of us really want the standards.  We, as programmers, wish that all the browsers would get behind the standards and make our life easier.  Imagine all the browsers handling DOM, JS, and Styles exactly the same.  I know it&#039;s a bit of a pipe dream but if we aren&#039;t willing to get behind the standards that are in place we have no business expecting the browser designers to get behind them.</description>
		<content:encoded><![CDATA[<p>Stand Proud Bro,</p>
<p>I agree with this article completely. innerHTML is going to be the death of us all as it represents a dirty little break from standards that proves to the browser designers that none of us really want the standards.  We, as programmers, wish that all the browsers would get behind the standards and make our life easier.  Imagine all the browsers handling DOM, JS, and Styles exactly the same.  I know it&#8217;s a bit of a pipe dream but if we aren&#8217;t willing to get behind the standards that are in place we have no business expecting the browser designers to get behind them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank ThÃ¼rigen</title>
		<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/comment-page-1/#comment-129</link>
		<dc:creator>Frank ThÃ¼rigen</dc:creator>
		<pubDate>Sat, 23 Jun 2007 17:52:45 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=26#comment-129</guid>
		<description>Dan,

I got a whole framework (I prefer the term &quot;toolkit&quot; though) that is based on innerHTML, and it does it to a virtually infinite number of recursion asynchronous... I really have to say that I was hesitating in the beginning to even try this approach - but the results have made me very optimistic. And, BTW, you have mail ;-)

Frank</description>
		<content:encoded><![CDATA[<p>Dan,</p>
<p>I got a whole framework (I prefer the term &#8220;toolkit&#8221; though) that is based on innerHTML, and it does it to a virtually infinite number of recursion asynchronous&#8230; I really have to say that I was hesitating in the beginning to even try this approach &#8211; but the results have made me very optimistic. And, BTW, you have mail <img src='http://www.javascriptkata.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Frank</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/comment-page-1/#comment-128</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 11 Jun 2007 19:08:58 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=26#comment-128</guid>
		<description>I really don&#039;t understand. Sorry!</description>
		<content:encoded><![CDATA[<p>I really don&#8217;t understand. Sorry!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nadeem</title>
		<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/comment-page-1/#comment-127</link>
		<dc:creator>Nadeem</dc:creator>
		<pubDate>Sat, 09 Jun 2007 09:04:29 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=26#comment-127</guid>
		<description>I have been searching for some code of javascript. was searching and landed here, thought that code shld work fine for me but it wasnot the case.
what i wish to do is, i want to get all images from some html code, lets say its in a textarea, want each code to be encapsulated by hyperlink tag i.e
[a href=&#039;url&#039;][img][/a]
but i wish to do this in html, it may look bbcode, but i have written it like that so that browser donot manuplate it.
is there some one to help me in this situation</description>
		<content:encoded><![CDATA[<p>I have been searching for some code of javascript. was searching and landed here, thought that code shld work fine for me but it wasnot the case.<br />
what i wish to do is, i want to get all images from some html code, lets say its in a textarea, want each code to be encapsulated by hyperlink tag i.e<br />
[a href='url'][img][/a]<br />
but i wish to do this in html, it may look bbcode, but i have written it like that so that browser donot manuplate it.<br />
is there some one to help me in this situation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bennett</title>
		<link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/comment-page-1/#comment-126</link>
		<dc:creator>Bennett</dc:creator>
		<pubDate>Tue, 29 May 2007 23:04:23 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=26#comment-126</guid>
		<description>Charles wrote: IE does not know how to attach a name to an input element after itâ€™s been created.

There&#039;s an nice solution to this problem: &lt;a href=&quot;http://www.thunderguy.com/semicolon/2005/05/23/setting-the-name-attribute-in-internet-explorer/&quot; rel=&quot;nofollow&quot;&gt;Setting the &quot;name&quot; attribute in Internet Explorer&lt;/a&gt;. Guaranteed 100% innerHTML-free.</description>
		<content:encoded><![CDATA[<p>Charles wrote: IE does not know how to attach a name to an input element after itâ€™s been created.</p>
<p>There&#8217;s an nice solution to this problem: <a href="http://www.thunderguy.com/semicolon/2005/05/23/setting-the-name-attribute-in-internet-explorer/" rel="nofollow">Setting the &#8220;name&#8221; attribute in Internet Explorer</a>. Guaranteed 100% innerHTML-free.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
