title: Posting comment with ajax and jquery
body: <p>I want to display the posted comment once the user comments. Just to add it under all of them as facebook does.</p>
  
  <p>I have this:</p>
  
  <pre><code> // Interceptamos el evento submit
      $('#CommentAddForm').submit(function() {
          alert("entro");
          alert($(this).attr('action'));
  
          // Enviamos el formulario usando AJAX
          $.ajax({
              type: 'POST',
              url: $(this).attr('action'),
              data: $(this).serialize(),
              // Mostramos un mensaje con la respuesta de PHP
              success: function(data) {
                  $('#result').html(//????????????);
              }
          });        
          return false;
      }); 
  </code></pre>
  
  <p>But i don't know very well how it works and i dont know what should i write in the line                     <code>$('#result').html(//????????????);</code></p>
  
  <p>The variable URL contains the route which inserts the comment in the DB. And it works well. 
  Any idea? Thanks.</p>
  
  <p>By the way, i have been reading this answer:
  <a href="https://stackoverflow.com/questions/5129955/ajax-jquery-comment-system">Ajax/jQuery Comment System</a>
  But i still don't get it.</p>