diff --git a/src/main/webapp/WEB-INF/view/jh/board/detailView.jsp b/src/main/webapp/WEB-INF/view/jh/board/detailView.jsp index e96ac2c..1074913 100644 --- a/src/main/webapp/WEB-INF/view/jh/board/detailView.jsp +++ b/src/main/webapp/WEB-INF/view/jh/board/detailView.jsp @@ -66,17 +66,17 @@ -
+ + **
- - - - - + +
+ + +
익명605.02 13:00 여기는 댓글의 @@ -87,13 +87,13 @@ class="date">05.02 13:00 여기는 댓글의 댓글(답글)정보!3333
- - -
+
+ ** + -->
목록 @@ -177,7 +177,7 @@ }) } - /* 댓글 불러오기 아주 엉망진창으로 진행되는중입니다~ */ + /* 댓글 불러오기 */ function callReply(boardId) { $.ajax({ url: "/api/jh/reply/boardReply/" + boardId, @@ -186,76 +186,41 @@ success: function(response) { console.log(response) - var commentBox = "" - $.each(response, function(i, item) { - console.log("부모 댓글 인덱스" + i) - console.log(item) - - /* comment */ + /* comment */ + $($(response).get().reverse()).each( function(i, item) { if(item.targetId==0) { var comment = "
" + - "" + "" + item.regUser + "" + "" + item.regDate + "" + "답글" + "" + "" + item.content + "" + - "
" + $(".comment-input").after(comment) + + /* reply */ $.each(item.targetReplys, function(idx, it) { + /* onclick으로 답글다는곳 나타나면 걔는 $('.reply-box').prepend(머시기) 하면 될듯 */ + var rb = $("
"); + $(".comment-view").append(rb); + var reply = - "
" + - /* 답글 눌렀을 때 뜨는 것 */ - "
" + - "" + - "" + it.regUser + "" + - "" + it.regDate + " + - "답글" + - "" + - "" + it.content + "" + - "
" + + "
" + + "" + + "" + it.regUser + "" + + "" + it.regDate + "" + + "" + + "" + it.content + "" + "
" + + $('#user' + (i+1)).append(reply) }) - console.log(comment) -// commentBox += comment; } - $(".comment-input").after(comment); - -// console.log("자식댓글") -// var replyBox = "" -// $.each(item.targetReplys, function(j, it) { -// /* 자식이 있을경우에만 살이 붙음 */ -// console.log(it) - -// // var boxbox = $('#' + it.targetId); - -// let rb = $("
"); //class reply-box라고 줘야함... 어케주지...... -// // $('#test3').append(rb) -// var targetId = it.targetId; -// $('#user' + (it.targetId)).append(rb) - - -// var reply = -// // "
" + -// "
" + -// "" + -// "" + it.regUser + "" + -// "" + it.regDate + "" + -// "답글" + -// "" + -// "" + it.content + "" + -// "
" -// // "
" -// rb.append(reply); -// replyBox += reply; -// }) - }) -// $(".comment-input").after(commentBox); /* 댓글 개수 */ var count = response.length