Ajax应用2
$.ajax({type: "POST", url: "jkhtAjaxAction.do?operFlag=query",data:"dypmc=" +dypmc, dataType:"josn",success: function(json){// eval转换成对象 varjson_obj=eval( "("+json+")"); var value = json_obj.mj; var value2 = json_obj.dyplx;}});response.setContentType("text/html");response.setHeader("Cathe-Control", "no-cache");response.setHeader("Pragma", "no-cache");List<Object> returnlist = new ArrayList<Object>();JSONArray jsonArray = new JSONArray();ZdjkhtdyqkbDAO zdhtzymxDAO = new ZdjkhtdyqkbDAO();returnlist = zdhtzymxDAO.getDyzd(dypid);jsonArray = JSONArray.fromObject(returnlist);response.getWriter().println(jsonArray.toString());
页:
[1]