1 $('#comment').on('submit', function(e) {
2 e.preventDefault();
3 var name = $('#name').val();
4 var message = $('#message').val();
5 var postid = $('#post_id').val();
6 $.ajax({
7 type: "POST",
8 url: host+'/comment/add',
9 data: {name:name, message:message, post_id:postid}
10 success: function( msg ) {
11 alert( msg );
12 }
13 });
14 });
15