当前位置: 代码迷 >> J2EE >> action发送字符串给js怎么接收
  详细解决方案

action发送字符串给js怎么接收

热度:92   发布时间:2016-04-17 23:27:53.0
action发送字符串给js如何接收
public String execute() throws Exception {
   ....
   String seriesData = "[" + str.toString().substring(1) + "]";  // 数据字符串
   result.put("seriesData", seriesData);
   ResponseUtil.write(ServletActionContext.getResponse(),result);
}
以上方法是字符串发给前端

问:
如何在 js中 接seriesData

java+struts+highcharts+jsp
感谢回答!



------解决思路----------------------
没有跨越的话就直接
$.getJSON(
    "xxxxxxxx",
    function(data) {
      alert(data.seriesData);
});
xxxxx 是你的地址。
  相关解决方案