is there a way to move a javascript function-arg into JSTL tag?
function loadList(listName) { <c:forEach var="item" items="${listName}">.... }
Why did this code"
x = '${item.category}';
work all good and suddenly it didn't work, but change to
x = "${item.category}";
does work? I did alert( message )
in page load to check if the page load success.
I don't think it is possible to put a javascript variable into a JSTL tag without a "postback" or reload of the page. However, the reverse (ie, putting a JSTL tag value into a javascript variable) should be possible.
The reason is the separation between server-side (JSTL) and client-side (Javascript) code.
'
or single qout
on the list.category
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.