user1762730
user1762730

Reputation: 53

passing jslt value to javascript

I trying to a pass a jslt value to javascript but the value is not getting rendered.

<c:forEach items="${requestScope.P.Releases}" var="pr" varStatus="status">     <a href=javascript:popPR('${pr.url}') class="linkPR">
     <c:out value="${pr.title}" escapeXml='false' /></a>
<c:foreach>

if directly type the pr.url value the popup window gets opened but if i pass the through jstl it does not call the popup.

Can anyone please suggest how to fix it.

Thanks

Upvotes: 0

Views: 89

Answers (1)

Louise Miller
Louise Miller

Reputation: 3199

Try using <c:out> to output the url :

<c:forEach items="${requestScope.P.Releases}" var="pr" varStatus="status">     
<a href=javascript:popPR('<c:out value="${pr.url}"/>') class="linkPR">
     <c:out value="${pr.title}" escapeXml='false' /></a>
<c:foreach>

Upvotes: 1

Related Questions