title: Is jQuery .text() method XSS safe?
body: <p>I have unescaped data from users. </p>
  
  <p>So is it safe to use like this:</p>
  
  <pre><code>var data = '&lt;test&gt;a&amp;f"#&lt;/test&gt;'; // example data from ajax response
  if (typeof(data) === 'string')
      $('body').text(data);
  </code></pre>
  
  <p>Can I use like this or there is some problems like encoding or some specific symbols that I should be careful and add more strict validation?</p>