title: jQuery - Stay at bottom of page
body: <p>Imagine a table with a thread of messages that fills the page - the user will automatically be scrolled down to the end of the thread and the bottom of the page. There is a textarea at the bottom which, through ajax and php, sends a message on button click and appends the table.</p>
  
  <p>Here is the code to do that:</p>
  
  <pre><code>//Call script to send message
  $.ajax({
      type: 'POST',
      url: 'action/sendmessage.php',
      data: 'partner='+partner+'&amp;message='+message,
      success: function(feedback){
          var json=$.parseJSON(feedback);
          if(json.success=='true'){
              $('#messagetext').val('');
              $('table &gt; tbody:last').hide().after(json.message).show(200);
              $('#messagetext').focus();
          }
      }
  }).error(function(){
      alert('The message could not be sent - please try again later.');
  });
  </code></pre>
  
  <p>The neat thing about this is that the effect works and all. However, through appending the table, the user gets "pushed" to about 100px <i>above</i> the bottom of the page - he doesn't stay <i>at</i> the bottom.</p>
  
  <p>How can I solve that so that after sending a message and appending the table, the user still stays at the bottom of the page?</p>