title: Insert and execute javascript
body: <p>I have a javascript variable:  </p>
  
  <pre><code>var foo='&lt;script type="text/javascript"&gt;alert("Hello World");&lt;\/script&gt;'  
  </code></pre>
  
  <p>The variable is inserted with element.innerHTML=foo; after an event occurs on the page, about 10 seconds after the page is loaded.  </p>
  
  <p>Is there a way to execute the 'alert' function right after the insertion?</p>