scipt
--------------------------------------------------------
function ajax(seq) {
var data = {"seq":seq};
$.ajax({
url : "ajax.do",
type : "POST",
dataType : "json",
data : data,
success : function(result) { alert("성공"+result);
$.each(result, function(i) {
$(alert(result[i]));
});
},
error : function(result) { alert("실패"+result);
}
});
}
서블릿
-------------------------------------------------------
@RequestMapping(value = "ajax.do")
public @ResponseBody List<String> egovAjax(FaqVO fvo, HttpServletRequest request) throws Exception {
System.out.println("들어왔다!!"+fvo);
List<String> faqseq = faqService.searchFaq1(fvo);
System.out.println(faqseq);
/*Map<String, Object> model = new HashMap<String, Object>();
model.put("divId", "."+tabName);
model.put("description", messageSource.getMessage(tabName, null, new Locale("kr")));*/
//return new ModelAndView(ajaxMainView, model);
return faqseq;
}
'Javascript > jQuery' 카테고리의 다른 글
jquery 정리.. (0) | 2016.04.07 |
---|---|
jQuery selectBox 컨트롤. (0) | 2014.10.30 |
layer popup drag move (0) | 2014.10.29 |
w3schools JQuery페이지 번역 (0) | 2013.10.10 |