jsp=============================================================
<%@page import="org.json.simple.JSONObject"%>
<%@page import="org.json.simple.JSONArray"%>
<%@ page language="java" contentType="text/xml; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String com_cont = String.valueOf(request.getAttribute("com_cont"));
String file_name = String.valueOf(request.getAttribute("file_name"));
String file_true_name = String.valueOf(request.getAttribute("file_true_name"));
String fl_idx = String.valueOf(request.getAttribute("fl_idx"));
JSONObject js_obj = new JSONObject();
js_obj.put("com_cont",com_cont);
js_obj.put("file_name",file_name);
js_obj.put("file_true_name",file_true_name);
js_obj.put("fl_idx",fl_idx);
out.print(js_obj.toJSONString());
%>
javascript======================================================
$.ajax({
type:"POST",
url:url,
data:params,
dataType: "json",
success:function(resultData){
//$("#result").html(args);
//console.log(resultData);
//var com_cont = $(resultData).find("com_cont").html();
var com_cont = resultData.com_cont;
setReplyForm(com_idx,com_cont);
},
//beforeSend:showRequest,
error:function(e){
alert(e.responseText);
}
});
댓글 없음:
댓글 쓰기