I have a variable ${bean.name}
how can i pass it to a javascript var? I've tried var name = "${bean.name}"
and var name = ${bean.name}
but it does not work.
my idea is to put it in a hidden input like in a hidden <input id="test" type="text" value"${bean.name}">
var name = document.getElementById("test").value;
this doen't work either var name
becomes the string "${bean.name}"
note. i can't use jstl
See Question&Answers more detail:os
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…