Update CommentLoadingTest.js
correct error : clear comment list when load new URL of video
Showing
1 changed file
with
4 additions
and
1 deletions
... | @@ -78,6 +78,9 @@ var app = http.createServer(function(request,response){ // request는 브라우 | ... | @@ -78,6 +78,9 @@ var app = http.createServer(function(request,response){ // request는 브라우 |
78 | response.end(body); | 78 | response.end(body); |
79 | } | 79 | } |
80 | else if(pathname === '/search'){ | 80 | else if(pathname === '/search'){ |
81 | + commentList.splice(0); | ||
82 | + commentNum = 0; //코멘트 리스트 초기화 | ||
83 | + | ||
81 | videoNum = queryData.videourl; | 84 | videoNum = queryData.videourl; |
82 | console.log(videoNum); | 85 | console.log(videoNum); |
83 | let npt = "" | 86 | let npt = "" |
... | @@ -98,7 +101,7 @@ var app = http.createServer(function(request,response){ // request는 브라우 | ... | @@ -98,7 +101,7 @@ var app = http.createServer(function(request,response){ // request는 브라우 |
98 | <body> | 101 | <body> |
99 | <form action="http://localhost:3000/search" method="get"> | 102 | <form action="http://localhost:3000/search" method="get"> |
100 | <p> | 103 | <p> |
101 | - <textarea name="videourl" placeholder="Write your video Url" value="${videoNum}"></textarea> | 104 | + <textarea name="videourl" placeholder="Write your video Url" >${videoNum}</textarea> |
102 | </p> | 105 | </p> |
103 | <p> | 106 | <p> |
104 | <input type="submit"> | 107 | <input type="submit"> | ... | ... |
-
Please register or login to post a comment