<?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: Javascript script execution in innerHTML: the revenge</title>
	<atom:link href="http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/feed/" rel="self" type="application/rss+xml" />
	<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/</link>
	<description>my very own personal corner</description>
	<lastBuildDate>Sun, 29 Aug 2010 17:26:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: smu johnson</title>
		<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/comment-page-1/#comment-5921</link>
		<dc:creator>smu johnson</dc:creator>
		<pubDate>Mon, 30 Nov 2009 23:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://kratorius.simosnap.net/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/#comment-5921</guid>
		<description>Ok, upon further investigation of my lead,  someone on IRC was kind enough to explain to me the correct workaround to fix this annoying IE issue:

15:00:04     @makk &#124; yeah, this is a known issue in IE
15:00:08     @makk &#124; there is a trick to get around it
15:00:14     @makk &#124; but i don&#039;t recommend it
15:00:32     @makk &#124; all you have to do is put some non-whitespace before the script tag
15:00:42     @makk &#124; and then you should be able to grab the element
15:01:24     @makk &#124; for example:  div.innerHTML = &#039;&#160;...&#039;;</description>
		<content:encoded><![CDATA[<p>Ok, upon further investigation of my lead,  someone on IRC was kind enough to explain to me the correct workaround to fix this annoying IE&nbsp;issue:</p>
<p>15:00:04     @makk | yeah, this is a known issue in IE<br />
15:00:08     @makk | there is a trick to get around it<br />
15:00:14     @makk | but i don&#8217;t recommend it<br />
15:00:32     @makk | all you have to do is put some non-whitespace before the script tag<br />
15:00:42     @makk | and then you should be able to grab the element<br />
15:01:24     @makk | for example:  div.innerHTML =&nbsp;&#8217;&nbsp;&#8230;&#8217;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: smu johnson</title>
		<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/comment-page-1/#comment-5920</link>
		<dc:creator>smu johnson</dc:creator>
		<pubDate>Mon, 30 Nov 2009 22:12:18 +0000</pubDate>
		<guid isPermaLink="false">http://kratorius.simosnap.net/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/#comment-5920</guid>
		<description>Ok, the problem with IE not working isn&#039;t the .text or .innerHTML confusion.  It is the fact that:  var st = node.getElementsByTagName(&#039;script&#039;);   doesn&#039;t behave the same in Firefox as it does in IE.  Everytime I get here in IE, it returns an array with st.length being 0 everytime.  So in other words, the for loop is never even executed.  Even trying to set DIV or SPAN or whatever your node is with .text = &#039;blah&#039; instead of .innerHTML makes no difference.</description>
		<content:encoded><![CDATA[<p>Ok, the problem with IE not working isn&#8217;t the .text or .innerHTML confusion.  It is the fact that:  var st = node.getElementsByTagName(&#8216;script&#8217;);   doesn&#8217;t behave the same in Firefox as it does in IE.  Everytime I get here in IE, it returns an array with st.length being 0 everytime.  So in other words, the for loop is never even executed.  Even trying to set DIV or SPAN or whatever your node is with .text = &#8216;blah&#8217; instead of .innerHTML makes no&nbsp;difference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: smu johnson</title>
		<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/comment-page-1/#comment-5918</link>
		<dc:creator>smu johnson</dc:creator>
		<pubDate>Mon, 30 Nov 2009 21:27:18 +0000</pubDate>
		<guid isPermaLink="false">http://kratorius.simosnap.net/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/#comment-5918</guid>
		<description>Ok, I got it to work in Firefox, but still no IE.  I know it says &quot;it doesn&#039;t like innerHTML!!!&quot; but what do we need to change then?  The function itself provided by this nice blog page or the actual javascript code where the DIV&#039;s and SPAN&#039;s are, etc, that have statements that change the innerHTML of them?</description>
		<content:encoded><![CDATA[<p>Ok, I got it to work in Firefox, but still no IE.  I know it says &#8220;it doesn&#8217;t like innerHTML!!!&#8221; but what do we need to change then?  The function itself provided by this nice blog page or the actual javascript code where the DIV&#8217;s and SPAN&#8217;s are, etc, that have statements that change the innerHTML of&nbsp;them?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: smu johnson</title>
		<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/comment-page-1/#comment-5899</link>
		<dc:creator>smu johnson</dc:creator>
		<pubDate>Sat, 28 Nov 2009 01:52:54 +0000</pubDate>
		<guid isPermaLink="false">http://kratorius.simosnap.net/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/#comment-5899</guid>
		<description>Hi.

Thanks for the post.  I found it after a few seconds of simple googling after I experienced this problem for a work related issue.  The thing is, what exactly is the &quot;node&quot; variable?  In other words, is there an example you can give as to how to run it?  I have a DIV tag that I&#039;d like to run it on and I am unsure if this is exactly what I want to do.  Of course, I haven&#039;t experimented with it yet, but maybe I&#039;ve answered my own question.  Either way, could you provide an example?  Keep up the good work!</description>
		<content:encoded><![CDATA[<p>Hi.</p>
<p>Thanks for the post.  I found it after a few seconds of simple googling after I experienced this problem for a work related issue.  The thing is, what exactly is the &#8220;node&#8221; variable?  In other words, is there an example you can give as to how to run it?  I have a DIV tag that I&#8217;d like to run it on and I am unsure if this is exactly what I want to do.  Of course, I haven&#8217;t experimented with it yet, but maybe I&#8217;ve answered my own question.  Either way, could you provide an example?  Keep up the good&nbsp;work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: don</title>
		<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/comment-page-1/#comment-303</link>
		<dc:creator>don</dc:creator>
		<pubDate>Fri, 29 Aug 2008 04:32:37 +0000</pubDate>
		<guid isPermaLink="false">http://kratorius.simosnap.net/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/#comment-303</guid>
		<description>This rocks.  Works fairly well.

Followup to comment 2 regarding how to deal with  src = url javascript files:

Downside: if you&#039;re refreshing the innerHTML, you might be appending innerHTML src&#039;d javascript files to the document head multiple times, leading to possible memory issues.  You&#039;ll want to check to see if you&#039;ve already loaded a file via this method.

Caught that using the DOM inspector while watching the page refresh.</description>
		<content:encoded><![CDATA[<p>This rocks.  Works fairly&nbsp;well.</p>
<p>Followup to comment 2 regarding how to deal with  src = url javascript&nbsp;files:</p>
<p>Downside: if you&#8217;re refreshing the innerHTML, you might be appending innerHTML src&#8217;d javascript files to the document head multiple times, leading to possible memory issues.  You&#8217;ll want to check to see if you&#8217;ve already loaded a file via this&nbsp;method.</p>
<p>Caught that using the DOM inspector while watching the page&nbsp;refresh.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kratorius</title>
		<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/comment-page-1/#comment-27</link>
		<dc:creator>kratorius</dc:creator>
		<pubDate>Mon, 06 Aug 2007 17:59:06 +0000</pubDate>
		<guid isPermaLink="false">http://kratorius.simosnap.net/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/#comment-27</guid>
		<description>uhm, I never noticed this behavior... Could you try if something like x.innerHTML = &quot;&lt;span&gt;&lt;/span&gt;&quot; + strExec; works?</description>
		<content:encoded><![CDATA[<p>uhm, I never noticed this behavior&#8230; Could you try if something like x.innerHTML = &#8220;&lt;span&gt;&lt;/span&gt;&#8221; + strExec;&nbsp;works?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kishore</title>
		<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/comment-page-1/#comment-17</link>
		<dc:creator>Kishore</dc:creator>
		<pubDate>Mon, 06 Aug 2007 06:24:25 +0000</pubDate>
		<guid isPermaLink="false">http://kratorius.simosnap.net/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/#comment-17</guid>
		<description>I guess something got snipped out in my earlier comment due to being a tag - it should be, &quot;the innerHTML cannot start with &lt;SCRIPT&gt;</description>
		<content:encoded><![CDATA[<p>I guess something got snipped out in my earlier comment due to being a tag - it should be, &#8220;the innerHTML cannot start with&nbsp;&lt;SCRIPT&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kishore</title>
		<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/comment-page-1/#comment-33</link>
		<dc:creator>Kishore</dc:creator>
		<pubDate>Mon, 06 Aug 2007 06:23:02 +0000</pubDate>
		<guid isPermaLink="false">http://kratorius.simosnap.net/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/#comment-33</guid>
		<description>Okay, it works in IE. But there is a weird problem - the innerHTML cannot start with . I put some other HTML before that, and put the script later. Cheers!</description>
		<content:encoded><![CDATA[<p>Okay, it works in IE. But there is a weird problem - the innerHTML cannot start with . I put some other HTML before that, and put the script later.&nbsp;Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kishore</title>
		<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/comment-page-1/#comment-32</link>
		<dc:creator>Kishore</dc:creator>
		<pubDate>Mon, 06 Aug 2007 06:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://kratorius.simosnap.net/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/#comment-32</guid>
		<description>BTW, the script is not working in IE. I tried alert(strExec) after:


} else {
      strExec = st[i].text;

but while it enters the loop (I checked), it prints an empty string.</description>
		<content:encoded><![CDATA[<p>BTW, the script is not working in IE. I tried alert(strExec)&nbsp;after:</p>
<p>} else {<br />
      strExec =&nbsp;st[i].text;</p>
<p>but while it enters the loop (I checked), it prints an empty&nbsp;string.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kishore</title>
		<link>http://zeta-puppis.com/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/comment-page-1/#comment-31</link>
		<dc:creator>Kishore</dc:creator>
		<pubDate>Mon, 06 Aug 2007 05:54:50 +0000</pubDate>
		<guid isPermaLink="false">http://kratorius.simosnap.net/2006/03/07/javascript-script-execution-in-innerhtml-the-revenge/#comment-31</guid>
		<description>Hi Kratoruis,

Thanks for a wonderful script. However, could you help with how src=&quot;something.js&quot; can be managed?</description>
		<content:encoded><![CDATA[<p>Hi&nbsp;Kratoruis,</p>
<p>Thanks for a wonderful script. However, could you help with how src=&#8221;something.js&#8221; can be&nbsp;managed?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
