茗哥网站建设,免费建站网站自助建站的网站建站,北京网站建设 招聘信息,网络营销论文题目前端js: var b1; $.ajax({ type : POST, --Post请求方式 url : orderController.do?wuliao, --路径 crossDomain : true, data: idb, --传入的id值 success : function(data) { datadata…前端js: var b1; $.ajax({ type : POST, --Post请求方式 url : orderController.do?wuliao, --路径 crossDomain : true, data: idb, --传入的id值 success : function(data) { datadata.replace([,); --返回的data数据 datadata.replace(],); var strs new Array(); //定义一数组 strsdata.split(,); //字符分割 }, error:function(){ alert(系统错误); } }) 后台代码返回的是[aa,bb,cc]类型的 RequestMapping(params wuliao) ResponseBody public void wuliao(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) throws IOException { String idrequest.getParameter(id); //接收传入的id值 String aa jdbcTemplate.queryForObject(select goods_name from wsc_goods where goods_id?,String.class,Integer.parseInt(id)); int bbjdbcTemplate.queryForInt(select goods_price from wsc_goods where goods_id?,Integer.parseInt(id)); String ccString.valueOf(bb); String dd jdbcTemplate.queryForObject(select goods_code from wsc_goods where goods_id?,String.class,Integer.parseInt(id)); String ff jdbcTemplate.queryForObject(select goods_model from wsc_goods where goods_id?,String.class,Integer.parseInt(id)); ListString list new ArrayListString(); list.add(aa); list.add(cc); list.add(dd); list.add(ff); JSONArray array new JSONArray(); array.add(list); response.getWriter().write(list.toString()); } 转载于:https://www.cnblogs.com/xujiating/p/6374115.html