change comments to use ajax
This commit is contained in:
18
website/public/js/post.js
Normal file
18
website/public/js/post.js
Normal 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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user