소스 검색

기타 수정

Gayeon Park 3 년 전
부모
커밋
f120c0a1b6
1개의 변경된 파일9개의 추가작업 그리고 9개의 파일을 삭제
  1. 9 9
      realworld/src/main/webapp/WEB-INF/jsp/main.jsp

+ 9 - 9
realworld/src/main/webapp/WEB-INF/jsp/main.jsp

@@ -94,7 +94,7 @@
         }, 2000);
     }
 
-
+    
     function favoriteBtn(indexNumber) {
         const favBtn = document.querySelectorAll('.favorite-btn');
         if ("${ssIsLogin}" === "true") {
@@ -139,14 +139,6 @@
                     console.log(JSON.stringify(article))
                     const domParser = new DOMParser();
 
-                    //태그 배열 생성
-                    const tagsArray = article.tags.split(',')
-                    tagsArray.forEach(tag => {
-                        if (tag !== '') {
-                            tagArray.push(tag);
-                        }
-                    })
-
                     const domStrArticleMeta =
                         `
                         <div class="article-meta">
@@ -214,6 +206,14 @@
                     }
 
                     articleList.appendChild(articlePreview); 
+
+                    //태그 배열 생성
+                    const tagsArray = article.tags.split(',')
+                    tagsArray.forEach(tag => {
+                        if (tag !== '') {
+                            tagArray.push(tag);
+                        }
+                    })
                 });
 
                 //태그 정렬