title: cross site scripting in JavaScript
body: <p>I am trying to resolve a cross site scripting exception in my code.
  I'm getting an XSS error at line where I was using JSP expression inside a JS code</p>
  
  <p><strong>ex:</strong> 
  <strong>inside a JS function</strong></p>
  
  <pre><code>function ex(){
      .....
      var loc = '&lt;%= location.getLocDetails()&gt;';
      .....
  }
  </code></pre>
  
  <p>Please let me know, if you have any solution/workaround?<br>
  Note: <code>location.getLocDetails()</code> returns a String</p>