<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>HTML Help</title>
  <link>http://www.htmlcodetutorial.com/help/index.php</link>
  <description>Please &lt;a href=&quot;http://www.htmlcodetutorial.com/help/search.php&quot;&gt;Search&lt;/a&gt; for the answer to your question before asking it! Thanks.</description>
  <language>english</language>
  <copyright>(c) Copyright 2009 by HTML Help</copyright>
  <managingEditor>design@htmlcodetutorial.com</managingEditor>
  <webMaster>design@htmlcodetutorial.com</webMaster>
  <pubDate>Sat Nov 21, 2009 5:10 pm</pubDate>
  <lastBuildDate>Sat Nov 21, 2009 5:10 pm</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>HTML Help</title>
    <url></url>
    <link>http://www.htmlcodetutorial.com/help/</link>
    <description>Please &lt;a href=&quot;http://www.htmlcodetutorial.com/help/search.php&quot;&gt;Search&lt;/a&gt; for the answer to your question before asking it! Thanks.</description>
  </image>

                                      <item>
                                        <title>Need more info</title>
                                        <link>http://www.htmlcodetutorial.com/help/viewtopic.php?p=34281#34281</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.htmlcodetutorial.com/help/profile.php?mode=viewprofile&amp;u=698'&gt;kanenas&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Mon Oct 08, 2007 1:46 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      What version of IE are you using?  What is the source for the script you're using?&lt;br /&gt;
&lt;br /&gt;
Try this (complete) example and tell me if it fails and with what error:&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;br /&gt;&lt;tr&gt; &lt;br /&gt;	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;br /&gt;	&lt;/tr&gt;&lt;br /&gt;	&lt;tr&gt;&lt;br /&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function show_AS&amp;#40;row_num&amp;#41; &amp;#123;&lt;br /&gt;
&amp;nbsp; document.writeln&amp;#40;&amp;quot;show_AS&amp;#40;&amp;quot;+row_num+&amp;quot;&amp;#41;&amp;lt;br&amp;gt;&amp;quot;&amp;#41;;&lt;br /&gt;
&amp;#125;&lt;br /&gt;
&lt;br /&gt;
function appendChild&amp;#40;node, text&amp;#41; &amp;#123;&lt;br /&gt;
&amp;nbsp; if &amp;#40;null == node.canHaveChildren || node.canHaveChildren&amp;#41; &amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; node.appendChild&amp;#40;document.createTextNode&amp;#40;text&amp;#41;&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;#125; else &amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; node.text = text;&lt;br /&gt;
&amp;nbsp; &amp;#125;&lt;br /&gt;
&amp;#125;&lt;br /&gt;
/*...*/&lt;br /&gt;
&lt;br /&gt;
var script = document.createElement&amp;#40;&amp;quot;script&amp;quot;&amp;#41;;&lt;br /&gt;
script.setAttribute&amp;#40;'type','text/javascript'&amp;#41;;&lt;br /&gt;
appendChild&amp;#40;script, &amp;quot;show_AS&amp;#40;1&amp;#41;;&amp;quot;&amp;#41;; &lt;br /&gt;
&lt;br /&gt;
document.body.appendChild&amp;#40;script&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;	&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Also think about alternatives to a dynamically created script element.  Could you accomplish the same task using (e.g.) events?</description>
                                        <comments>http://www.htmlcodetutorial.com/help/viewtopic.php?p=34281#34281</comments>
                                        <author>kanenas</author>
                                        <pubDate>Mon Oct 08, 2007 1:46 pm</pubDate>
                                        <guid isPermaLink="true">http://www.htmlcodetutorial.com/help/viewtopic.php?p=34281#34281</guid>
                                      </item>
                                      <item>
                                        <title>Not working</title>
                                        <link>http://www.htmlcodetutorial.com/help/viewtopic.php?p=34227#34227</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.htmlcodetutorial.com/help/profile.php?mode=viewprofile&amp;u=17895'&gt;thamizh&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Oct 06, 2007 1:29 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi,&lt;br /&gt;
&lt;br /&gt;
I tried with your way. but still IE is having some problem. It did not accept node.text = scriptContent;&lt;br /&gt;
&lt;br /&gt;
My IE crashed once that particular line is executed. &lt;br /&gt;
&lt;br /&gt;
But in firefox dynamic &amp;lt;script&amp;gt; element creation is working.&lt;br /&gt;
&lt;br /&gt;
I need your answer. this is very urgent. can you help me out?&lt;br /&gt;
&lt;br /&gt;
thanks&lt;br /&gt;
&lt;br /&gt;
- thamizharasu S</description>
                                        <comments>http://www.htmlcodetutorial.com/help/viewtopic.php?p=34227#34227</comments>
                                        <author>thamizh</author>
                                        <pubDate>Sat Oct 06, 2007 1:29 am</pubDate>
                                        <guid isPermaLink="true">http://www.htmlcodetutorial.com/help/viewtopic.php?p=34227#34227</guid>
                                      </item>
                                      <item>
                                        <title>For IE, use 'text' property of script nodes.</title>
                                        <link>http://www.htmlcodetutorial.com/help/viewtopic.php?p=2801#2801</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.htmlcodetutorial.com/help/profile.php?mode=viewprofile&amp;u=698'&gt;kanenas&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Jan 25, 2005 12:43 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      IE doesn't allow script tags to have children; the 'text' property can be used instead.  Try this:&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;br /&gt;&lt;tr&gt; &lt;br /&gt;	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;br /&gt;	&lt;/tr&gt;&lt;br /&gt;	&lt;tr&gt;&lt;br /&gt;	  &lt;td class=&quot;code&quot;&gt;/*...*/&lt;br /&gt;
function appendChild&amp;#40;node, text&amp;#41; &amp;#123;&lt;br /&gt;
&amp;nbsp; if &amp;#40;null == node.canHaveChildren || node.canHaveChildren&amp;#41; &amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; node.appendChild&amp;#40;document.createTextNode&amp;#40;text&amp;#41;&amp;#41;; &lt;br /&gt;
&amp;nbsp; &amp;#125; else &amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; node.text = text;&lt;br /&gt;
&amp;nbsp; &amp;#125;&lt;br /&gt;
&amp;#125;&lt;br /&gt;
/*...*/&lt;br /&gt;
var script = document.createElement&amp;#40;&amp;quot;script&amp;quot;&amp;#41;;&lt;br /&gt;
script.setAttribute&amp;#40;'type','text/javascript'&amp;#41;;&lt;br /&gt;
appendChild&amp;#40;script, &amp;quot;show_AS&amp;#40;&amp;quot;+row_num+&amp;quot;&amp;#41;;&amp;quot;&amp;#41;;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;	&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
As long as the non-method appendChild is only called on script nodes, you can omit the test of node.canHaveChildren, as it will always be false.  I don't know if you're setting the 'type' attribute of the script elsewhere; if not, add that step as above.&lt;br /&gt;
&lt;br /&gt;
Out of curiosity, why do you need to dynamically create the script?</description>
                                        <comments>http://www.htmlcodetutorial.com/help/viewtopic.php?p=2801#2801</comments>
                                        <author>kanenas</author>
                                        <pubDate>Tue Jan 25, 2005 12:43 am</pubDate>
                                        <guid isPermaLink="true">http://www.htmlcodetutorial.com/help/viewtopic.php?p=2801#2801</guid>
                                      </item>
                                      <item>
                                        <title>create &amp;lt;script&amp;gt; element problem in IE</title>
                                        <link>http://www.htmlcodetutorial.com/help/viewtopic.php?p=2659#2659</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.htmlcodetutorial.com/help/profile.php?mode=viewprofile&amp;u=1015'&gt;wakan&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Jan 20, 2005 4:26 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi, &lt;br /&gt;
I'm creating a script tag in this way:&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;br /&gt;&lt;tr&gt; &lt;br /&gt;	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;br /&gt;	&lt;/tr&gt;&lt;br /&gt;	&lt;tr&gt;&lt;br /&gt;	  &lt;td class=&quot;code&quot;&gt;&lt;br /&gt;
var text&amp;nbsp; &amp;nbsp;= d.createTextNode&amp;#40;&amp;quot;show_AS&amp;#40;&amp;quot;+row_num+&amp;quot;&amp;#41;;&amp;quot;&amp;#41;;&lt;br /&gt;
var script&amp;nbsp; &amp;nbsp;= d.createElement&amp;#40;&amp;quot;script&amp;quot;&amp;#41;; script.appendChild&amp;#40;text&amp;#41;;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;	&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
where row_num is a counter...(I'm dinamically adding rows to a table)&lt;br /&gt;
in &lt;span style=&quot;font-weight: bold&quot;&gt;Firefox&lt;/span&gt;, this works fine...(I have other big problem in Firefox, but I'll hope to ask later this question of the script tag)&lt;br /&gt;
in &lt;span style=&quot;font-weight: bold&quot;&gt;IE&lt;/span&gt; it doesn't work: it says that I can't append &lt;span style=&quot;font-weight: bold&quot;&gt;text&lt;/span&gt; to the &lt;span style=&quot;font-weight: bold&quot;&gt;script&lt;/span&gt; element...&lt;br /&gt;
any answer?&lt;br /&gt;
thanks in advance&lt;br /&gt;
Ciao</description>
                                        <comments>http://www.htmlcodetutorial.com/help/viewtopic.php?p=2659#2659</comments>
                                        <author>wakan</author>
                                        <pubDate>Thu Jan 20, 2005 4:26 am</pubDate>
                                        <guid isPermaLink="true">http://www.htmlcodetutorial.com/help/viewtopic.php?p=2659#2659</guid>
                                      </item></channel></rss>