티스토리 뷰

카테고리 없음

[JQuery] ajax1

진열사랑 2020. 10. 8. 09:40

ajax success 함수의 parameter를 출력해 보면 다음과 같다.

result : java에서 return한 modelAndView

textStatus : "success"

jqXHR : 

layerList : function(){
	$.ajax({
		url : gisApp.contextPath +"tree.do",
		type: "get",
		dataType: "json",
		success : function(result, textStatus, jqXHR){
			console.log(result);
			console.log(textStatus);
			console.log(jqXHR);
			gisApp.makeTree(result); // 좌측 layer tree 생성
			//gisApp.makeLayerSelect(result);
		}
	});
}
// MapController.java
	@RequestMapping(value="/tree.do")
	public ModelAndView tree(ModelAndView model) throws Exception {
		model.addObject("data",mapService.tree());
		model.setViewName("jsonView");		
		return model;
	}	
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함