title: jQuery + client-side template = "Syntax error, unrecognized expression"
body: <p>I just updated jQuery from 1.8.3 to 1.9, and it started crashing all of a sudden.</p>
  
  <p>This is my template:</p>
  
  <pre><code>&lt;script type="text/template" id="modal_template"&gt;
      &lt;div&gt;hello&lt;/div&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>This is how I read it:</p>
  
  <pre><code>modal_template_html = $("#modal_template").html();
  </code></pre>
  
  <p>This is how I transform it into jQuery object (I need to use jQuery methods on it):</p>
  
  <pre><code>template = $(modal_template_html);
  </code></pre>
  
  <p>... and jQuery crashes!</p>
  
  <p>Error: Syntax error, unrecognized expression: &lt;div&gt;hello&lt;/div&gt;</p>
  
  <p>slice.call( docElem.childNodes, 0 )[0].nodeType;</p>
  
  <p>jquery-1.9.0.js (line 3811)</p>
  
  <p>However, if I declare template as a plain text variable, it starts working again:</p>
  
  <pre><code>var modal_template_html = '&lt;div&gt;hello&lt;/div&gt;';
  </code></pre>
  
  <p>Can anyone help me to figure this out?</p>
  
  <p><strong>UPDATE</strong>:
  Jquery team heard and <a href="http://blog.jquery.com/2013/05/09/jquery-1-10-beta-1-released/">changed</a> things back to normal in 1.10:</p>
  
  <blockquote>
    <p>The biggest change you’re likely to see is that we’ve loosened up the criteria for HTML processing in $(), allowing leading spaces and newlines as we did before version 1.9</p>
  </blockquote>