숙제로 되어있어서 질문드립니다.
<h4 class="todotitle" data-id="<%= posts[i]._id %>">할일제목: <%= posts[i].제목 %></h4>
$('.todotitle').click(function(e){
console.log('클릭');
let 글번호 = e.target.dataset.id;
$.ajax({
method:'GET',
url:'/detail/:'+글번호,
})
})
이런식으로 했는데, 클릭을 해도 console에만 '클릭'이 뜨고 detail 페이지로는 이동이안됩니다.
server.js에는
app.get('/detail/:id',function(req,res){
db.collection('post').findOne({_id : parseInt(req.params.id) },function(err,client){
res.render('detail.ejs',{ data : client });
})
})
이 입력되어 있는 상태구요
어떻게 구현해야하는건가요 ?