How to upgrade a unit after you added the record in database, ajax?

Write comments, want to update the comment block, after the added comments by users.
Ajax
$(document).ready(function (){
 $("#comment").submit(function (e){
e.preventDefault();
$("#loader").show();
 var url = $(this).attr('action');
 //var data = new FormData($('#update')[0]);
 var data = $('#comment').serialize();
$.ajax({
url:url,
type:'POST',
data:data
 }).done(function (data){
$("#response").html(data);
$("#loader").hide();
});
});
 });

Now just displays error or success #response.
public function save_comment(){
 //$this->form_validation->set_error_delimiters("<span class="error">", "</span>");
$this->load->library('users/auth');
$this->set_current_user();
 $this->form_validation->set_rules('comment', 'Comment', 'required');
 $this->form_validation->set_rules('series_id', ", 'numeric');
 if($this->form_validation->run() === FALSE){
 /*return false;*/
 echo "
 <div class="alert alert-block alert-error fade in">
 <a class="close" data-dismiss="alert">×</a>
 <h4 class="alert-heading">
".lang('series_errors_message')."
</h4>
".validation_errors()."
</div>";
 } else {
$this->series_model->save_comment();
}

 }
July 9th 19 at 13:25
1 answer
July 9th 19 at 13:27
Well, the unit should be loaded from the database, or just when you reload the page, or Aaham, though why AJAX, this is not a chat.

Find more questions by tags AJAXCodeIgniterMySQLPHP