change comments to use ajax

This commit is contained in:
Hendrik
2017-01-26 12:21:01 +01:00
parent 328f0665f3
commit 91aca6baa7
5 changed files with 30 additions and 18 deletions

18
website/public/js/post.js Normal file
View File

@@ -0,0 +1,18 @@
function postComment() {
$.post(
"API/postComment.php",
$("#newcommentform").serialize()
);
$("#newcomment").val("");
//reload post
$.get(
"API/loadPost.php",
$("#newcommentform").serialize()
).done(function (data) {
$('#modal-response').html(data);
});
}