From f3104630adf903324688204360da3545fb68d030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jhlee=28=EC=9D=B4=EC=A4=80=ED=9D=AC=29?= Date: Mon, 16 May 2022 16:51:26 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8C=93=EA=B8=80=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/view/jh/board/detailView.jsp | 95 ++++++------------- 1 file changed, 30 insertions(+), 65 deletions(-) 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