js取el中的map值及js replaceAll实现
<%
Map map = new HashMap(); map.put("20",0); map.put("21",1); request.setAttribute("map",map);
%>
js中不能直接如下取值 var key = "21"; alert("${map}");//想直接实现这种取值效果,不行
下面通过转成json来实现
<%
Map map = new HashMap(); map.put("20",0); map.put("21",1); request.setAttribute("map",map);
%>
js中不能直接如下取值 var key = "21"; alert("${map}");//想直接实现这种取值效果,不行
下面通过转成json来实现
暂无评论。
评论功能维护中,当前仅展示历史评论。