<% String email =(String) request.getSession().getAttribute("email");
session.setAttribute("email", email);
%>
<script>
function test() {
var email = ${fn:escapeXml(email)}
}
</script>
以上操作无效
我也尝试过使用引号"${fn:escapeXml(email)}"; or '${fn:escapeXml(email)}'; or "${fn:escapeXml(email)};"
....他们都没有工作。我也尝试过
如果我<span id="email" value="${fn:escapeXml(email)}">${fn:escapeXml(email)}</span>
它说找不到函数fn:escapeXml
我收到的错误消息是:Uncaught SyntaxError: Invalid or unexpected token
如何在JavaScript中将scriptlet设置为变量?