<script>
var nameList=new Array();
var areaIdList=new Array();
<c:forEach items="${area}" var="area" varStatus="status">
nameList[${status.index}]="${area.areaName}";
areaIdList[${status.index}]="${area.areaId}";
</c:forEach>
</script>
原文:http://www.cnblogs.com/wangzhuxing/p/5210805.html