I have the below code in my JSP. UI displays every character correctly other than "&".
<c:out value="<script>var escapedData=unescape('${column}');
$('div').html(escapedData);</script>" escapeXml="false" /> </div>
E.g. 1) working case
input = ni!er@
Value in my escapedData
variable is ni%21er%40
. Now when I put it in my div
using
$('div').html(escapedData);
then o/p on html is as expected
E.g. 2) Issue case
input = nice&
Value in my escapedData
variable is nice%26
. Now when I put it in my div
using
$('div').html(escapedData);
then also it displays below
$('#test20').html('nice%26');
However, when output is displayed in JSP, it just prints "nice". It truncates everything after &
.
Any suggestions?