작성
·
327
답변 6
0
0
-----------------------index.html-------------------
<div class="bottom_icons">
<div class="left_icons">
<div class="heart_btn">
<div class="sprite_heart_icon_outline" data-name="heartbeat"></div>
</div>
<div class="sprite_bubble_icon"></div>
<div class="sprite_share_icon" data-name="share"></div>
</div>
<div class="right_icons">
<div class="sprite_bookmark_icon_outline" data-name="bookmark" ></div>
</div>
</div>
0
-----------------------main.js------------------------
if (elem.matches('[data-name="heartbeat"]')){
console.log("heart");
$.ajax({
type : "POST",
url : "data/like.json",
data : 37,
dataType:'json',
success : function(response){
let likeCount = document.querySelector('#like-count-37');
likeCount.innerHTML = '좋아요'+ response.like_count + '개';
}
})
}else if (elem.matches('[data-name="bookmark"]')){
console.log("bookmark");
}else if (elem.matches('[data-name="share"]')){
console.log("share");
}else if (elem.matches('[data-name="more"]')){
console.log("more");
}
0
0
0
jquery-3.5.1.js:10099 POST http://127.0.0.1:5500/data/like.json 405 (Method Not Allowed)
오류 내용입니다.