In my page, I have added a comment box. Now, when the page loads, it auto-scrolls to the position in the page where the comment box is present and where the cursor is. Is there any way to prevent scrolling using JavaScript?


You can set the scroll position once the page is loaded using below code in JavaScript:

window.onload = function(e){ 
    window.scrollTo(0, 0);
  • It's not working when I display this page as a popup (IsDlg=1)
    – Kay
    May 5 '17 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.