How does one run javascript that has been inserted into a .innerHTML in embedded form?
<p>Is this possible?</p>

<p>I inserted a simple test snippet like this</p>

<pre><code>&lt;script type="text/javascript"&gt;//&lt;![CDATA[ 
document.write('foo');
//]]&gt;&lt;/script&gt; 
</code></pre>

<p>but it does nothing. ( W3 schools suggest the use of CDATA <a href="http://www.w3schools.com/tags/tag_script.asp" rel="nofollow">here</a>, but this did not help ).</p>

<p>To reiterate this snippet was written into the .innerHTML property of the body tag.</p>

<p>I've seen some mentions of eval() on google but not too sure if this is relevant or good practice?</p>

<p>Wrapping the code in eval like they do <a href="http://www.w3schools.com/jsref/jsref_eval.ASP" rel="nofollow">here at W3</a> has no effect.</p>
