title: jQuery: Evaluate script in ajax response
body: <p>XML responses from my webapp have both HTML to add to the page AND some have a script to run.</p>
  
  <p>I'm trying to send back XML from my webapp like:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;doc&gt;
    &lt;html-to-insert&gt;
      &lt;![CDATA[&lt;p&gt;add me to the page&lt;/p&gt;]]&gt;
    &lt;/html-to-insert&gt;
    &lt;script&gt;
      &lt;![CDATA[ alert('execute me'); ]]&gt;
    &lt;/script&gt;
  &lt;/doc&gt;
  </code></pre>
  
  <p>What I'm doing now is snapping out the <code>&lt;html-to-insert&gt;</code> and <code>&lt;script&gt;</code> CDATA, inserting the html into the page and eval'ing <code>&lt;script&gt;</code>.</p>
  
  <p>I'm looking for criticism on my approach.  Any suggestions from anyone?</p>