title: Scroll to bottom of div after AJAX done
body: <p>I've seen here how to scroll to the bottom of a div...
  But somehow it's not working for me...the same with autofocus.</p>
  
  <p>Guess the problem is that I do an AJAX call, and it doesn't work.</p>
  
  <p>My AJAX call:</p>
  
  <pre><code>  function toonBericht(vuserid) {
      $("#verstuurbericht").show();
      $("#chatresultaatcontent").val("");
  
      $.ajax({
        type: "GET",
        data: { userid:vuserid }, 
        url: './query/berichten/getbericht.php',
        success: function(result) {
          $("#chatresultaatcontent").html(result);
          var objDiv = document.getElementById("chatresultaatcontent");
          objDiv.scrollTop = objDiv.scrollHeight;
        }
      });
    }
  </code></pre>
  
  <p>Then ofcourse I have a div called #chatresultaatcontent.
  It contains the chat messages that have been sent back and forth.</p>
  
  <p>As an alternative I also tried loading a function (i.e. scrollBottom()) after success with the following code:</p>
  
  <pre><code>$("#chatresultaatcontent").scrollTop($("#chatresultaatcontent")[0].scrollHeight);
  </code></pre>
  
  <p>This also doesn't do anything. Same problem when trying to autofocus on a field after success...anybody know's why?</p>