title: How to scroll to top of page with JavaScript/jQuery?
body: <p>Is there a way to control browser scrolling with JavaScript/jQuery?</p>
  
  <p>When I scroll my page half way down, then trigger a reload, I want the page to go pack to the top, but instead it tries to find the last scroll position. So I did this:</p>
  
  <pre><code>$('document').ready(function() {
     $(window).scrollTop(0);
  });
  </code></pre>
  
  <p>But no luck.</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>So both your answers worked when I call them after the page loads-Thanks. However, if I just do a refresh on the page, looks like the browser calculates and scrolls to its old scroll position AFTER the <code>.ready</code> event (I tested the body onload() function too).</p>
  
  <p>So the follow up is, is there a way to PREVENT the browser scrolling to its past position, or to re-scroll to the top AFTER it does its thing?</p>