4
I was hoping that when the page was uploaded, it would automatically go to the end of the page. I don’t want to use jquery because the project is relatively simple. It’s not necessary. I used the following code:
<body onload="toBottom();">
</body>
function toBottom(){ var elem = document.querySelector("body"); elem.scrollTop = elem.scrollHeight; }
It works when page loads, ok! Only when I give refresh no. Only if I close the page, and log in again. How to resolve this?
In reality your solution only works because you are added items to
HTML
within theJavascript
. If you leave theHTML
fixed will not work.– Sorack
It works yes, if look at the issues I had done otherwise, but not to get too big the code refatorei and I did so
– Marco Vinicius Soares Dalalba