-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomment.js
28 lines (26 loc) · 984 Bytes
/
comment.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function addComment(beach_num){
console.log($("#user_name").val());
console.log($("#user_star").val());
console.log($("#user_content").val());
var data={
"name": $("#user_name").val(),
"password": $("#user_pwd").val(),
"content": $("#user_content").val(),
"star": $("#user_star").val()
}
// let _urlParams = new URL(window.location.href);
// _urlParams = _urlParams.searchParams;
// let _beach_num=_urlParams.get('num');
$("#comments_list").append('<hr>'+'<h6 id="comment_name" class="fw-bold">'+$("#user_name").val()+'</h6><p>평점: '+$("#user_star").val()+'</p><p >'+$("#user_content").val()+'</p>');
$.ajax({
'url':'/board/write?bn='+String(beach_num), //express에서의 url
'data':data,
'dataType':'json',
'type':'POST',
success:function(result){
console.log(result);
},complete:function(){
console.log('완료');
}
});
}