Code, jstlMarch 21, 2007 1:03 pm
Set JavaScript Array Values from JSTL Iteration Tags
Here is a simple example that shows how to populate Javascript array values from JSTL iteration tags:
<script type=’text/javascript’>
var arr = new Array();
<c:forEach begin="1" end="5" var="current">
arr.push(<c:out value="${current}" />);
</c:forEach>
</script>
The Javascript arr array now contains values from 1 to 5.
JSTL Books on Amazon.com
The URI to TrackBack this entry is: http://jdev.blogsome.com/2007/03/21/set-javascript-array-values-from-jstl-iteration-tags/trackback/
RSS feed for comments on this post.
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Excellent. It really helped me.
Comment by Paul — March 14, 2008 @ 5:32 pm