js接收java后台的传值,java后台传值给js
后台action:
request.put("toposJson",“xxxxxxxx”);
前台jsp:
<%
//json
String toposJson = (String)request.getAttribute("toposJson");
%>
前台js获取值
<script type="text/javascript">
//json格式topo数据
var toposJson ="<%=toposJson%>";
</script>
另一种方式就是异步处理方式了:Ajax
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: 发行你自己的 ICO - 发行前的考虑
- 下一篇: 关于C语言开大数组溢出的问题