<% String email =(String) request.getSession().getAttribute("email");
session.setAttribute("email", email);
%>
<script>
function test() {
var email = ${fn:escapeXml(email)}
}
</script>
Above does not work
I have also tried put quotes "${fn:escapeXml(email)}"; or '${fn:escapeXml(email)}'; or "${fn:escapeXml(email)};"
.... and none of them are working. I have also tried
If I do <span id="email" value="${fn:escapeXml(email)}">${fn:escapeXml(email)}</span>
It says cannot find function fn:escapeXml
Error message I got was: Uncaught SyntaxError: Invalid or unexpected token
How do I set scriptlet to variable in javascript?