1
這可能嗎?將jstl的foreach varStatus傳遞給javascript
<c:forEach var="list" items="${requestScope.data}" varStatus="count">
<script>
myFunction(false,[]) // this is where i want to pass the `varStatus` on 2nd argument
</script>
</c:forEach>
我一直試圖把這樣的:
myFunction(false,${count.index});
myFunction(false,<c:out value="${count.index}"></c:out>);
這些都不奏效。任何幫助,將不勝感激。謝謝!
$ {} count.index工作對我來說。沒有什麼輸出你得到了嗎? – rickz 2014-11-06 04:32:03
@rickz說undefined。 – Yaje 2014-11-06 05:24:23