首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

jquery ajax后台老板向前台传list 前台用jquery $.each遍历list

2012-12-29 
jqueryajax后台向前台传list 前台用jquery $.each遍历list下边是两种前台接收并遍历list下边是后台接收并

jquery ajax后台向前台传list 前台用jquery $.each遍历list
下边是两种前台接收并遍历list



下边是后台接收并遍历list

HttpServletResponse res = ServletActionContext.getResponse();res.reset();res.setContentType("text/html;charset=utf-8");PrintWriter pw = res.getWriter();xxx.setId(1);xxx.setName("黑色头发");list.add(xxx);xxx.setId(2);xxx.setName("紫色头发");list.add(xxx);String json = JSONArray.fromObject(list).toString(); pw.print(json);pw.flush();pw.close();


黑色头发:http://heisetoufa.iteye.com/

热点排行