title: prevent script execution on load (or parsing) in jQuery
body: <p>i have an "ajax engine" based on jQuery. And after receiving the response i must manipulate the response before inserting in page. But I need the response as an jQuery object.
  I do this with:</p>
  
  <pre><code>tmpActualResult = $( '&lt;span/&gt;' ).html( actualResult );
  </code></pre>
  
  <p>But at this time jQuery (or browser itself?) execute the scripts which are included in response - and exactly this shouldn't occur. I will execute the scripts manual later.</p>
  
  <p>in particular I will:</p>
  
  <ol>
  <li>parse response (get access to the tags/elements which are included)</li>
  <li>insert the elements into page (DOM manipulating)</li>
  <li>execute possible scripts (which are received)</li>
  </ol>
  
  <p>in thanks</p>
  
  <p>Edit:
  If someone is interested too, i've created a more general solution by extending the jQuery.domManip function, as suggested in first answer.</p>
  
  <pre><code>(function($, oldDomManip) {
  // Override the core domManip function
  $.fn.domManip = function() {
  
      function evalScript(i, elem) {
          jQuery.globalEval(elem.text || elem.textContent || elem.innerHTML || "");
      }
  
      var scripts = [];
      // let jQuery build the fragments
      var results = jQuery.buildFragment(arguments[0], this, scripts);
      // change parameter to created fragments
      arguments[0] = results.fragment.childNodes;
      // do what jQuery will do - without scripts
      oldDomManip.apply(this, arguments);
      if (scripts.length) {
          // if connection is active
          if (jQuery.active != 0) {
              $(this).bind("ajaxStop.scriptCache", function() {
                  $.each(scripts, evalScript);
                  $(this).unbind("ajaxStop.scriptCache");
              });
          } else
              $.each(scripts, evalScript);
      }
      return this;
  };
  })(jQuery, jQuery.fn.domManip);
  </code></pre>
  
  <p>it will not execute scripts before ajax request is completed. worked for me.</p>