title: difference between xss encoding in javascript and html
body: <p>I have a few questions on encoding/escaping characters to protect against cross site scripting ( XSS ).</p>
  
  <ol>
  <li><p>Can the same character encoding used for HTML encoding be used for JavaScript ? For eg ..in HTML encoding <code>&lt;</code> gets encoded as <code>&amp;lt;</code> Can I use the same for JavaScript? Are there any built in JavaScript encoding apis?</p></li>
  <li><p>Apart from the characters <code>&lt;</code> , <code>&gt;</code> , <code>'</code> , <code>"</code> , <code>&amp;</code> what other characters should I consider for output encoding?</p></li>
  </ol>