Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/04/2018 in all areas

  1. To make it clear on what is happening, the function within the load() is triggered after the content is loaded and load() function finished. That is why you didn't see the result you expected, the load() function was still in progress, when the scroll to top code was triggered.
    1 point
  2. Just to make it clear to some of those watching! This has everything to do with the code. <script> $(document).ready(function() { $('.pmbutton').click(function(e) { $('.mail_text').load('scripts/message.php', {id: $(this).data('id'), id2: $(this).data('id2')}, function() { var objDiv = document.getElementById("mail_text"); objDiv.scrollTop = objDiv.scrollHeight; }); }); }); </script>
    1 point
  3. You can put a <script> tag with a src attribute preceding your code. Some people like to use Javascript to generate script tags, but if you can just write the HTML for it I find that to be a better solution. <script src="arrays.js"></script> <script> This code uses the array </script>
    1 point
×
×
  • Create New...