프로그래밍/JavaScript

ajax 처리 후 List값으로 HTML형식 만들기

허석구 2017. 12. 18. 19:56

ajax 처리 후 List값으로 HTML형식 만들기


  

ajax로 뽑아온 데이터를 Div.productList태그에 append 시키려고한다.


 $.ajax({
	         url : 'productInfo.do',
	         data : JSON.stringify(data),
	         contentType : 'application/json;charset=UTF-8',
	         dataType : 'json',
	         type : 'post',
	         success : function(data) {
	            $.each(data, function() {
	  
	               $(".productList).append("
  • "+ this.otherPrice+"원" + this.otherPlus+ this.otherDily + "

"); })

append는 덧붙이기 / html은 새로 쓰기