title: Refresh Page and Keep Scroll Position
body: <p>Can someone show me what i'm doing wrong? I need  my page to refresh after a certain period of time, but it refreshes to the top of the page, I need it to not change the page location!So this is what I have now not working is it the meta tags? Here is what I have no still doesn't refresh must be doing something wrong?</p>
  
  <p>Here is what I originally had...</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="refresh" content="72"&gt;
          &lt;meta http-equiv="Pragma" CONTENT="no-cache"&gt;
          &lt;meta http-equiv="Expires" CONTENT="-1"&gt;
  
          &lt;style type="text/css"&gt;
          body
          { 
              background-image: url('../Images/Black-BackGround.gif');
              background-repeat: repeat;
          }
          &lt;/style&gt;
      &lt;/head&gt;
  
      &lt;script type="text/javascript"&gt;
  
      function saveScrollPositions(theForm) {
          if(theForm) {
              var scrolly = typeof window.pageYOffset != 'undefined' ? window.pageYOffset
                                                     : document.documentElement.scrollTop;
              var scrollx = typeof window.pageXOffset != 'undefined' ? window.pageXOffset
                                                    : document.documentElement.scrollLeft;
              theForm.scrollx.value = scrollx;
              theForm.scrolly.value = scrolly;
          }
      }
      &lt;/script&gt;
  
   &lt;form action="enroll.php" name="enrollment" method="post" onsubmit="return saveScrollPositions (this);"&gt;
    &lt;input type="hidden" name="scrollx" id="scrollx" value="0" /&gt;
    &lt;input type="hidden" name="scrolly" id="scrolly" value="0" /&gt;
  
    &lt;STYLE type="text/css"&gt;
     #Nav a{ position:relative; display:block; text-decoration: none; color:Black; }
     Body td{font-Family: Arial; font-size: 12px; }
    &lt;/style&gt;
  </code></pre>
  
  <p>After reading some of the initial answers I've changed it to this...</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
  &lt;html&gt;
  &lt;head&gt;
  
  &lt;style type="text/css"&gt;
  body
  { 
      background-image: url('../Images/Black-BackGround.gif');
      background-repeat: repeat;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  
  
  &lt;script&gt;
  function refreshPage () {
      var page_y = $( document ).scrollTop();
      window.location.href = window.location.href + '?page_y=' + page_y;
  }
  window.onload = function () {
      setTimeout(refreshPage, 35000);
      if ( window.location.href.indexOf('page_y') != -1 ) {
          var match = window.location.href.split('?')[1].split("&amp;")[0].split("=");
          $('html, body').scrollTop( match[1] );
      }
  }
  &lt;/script&gt;
  
  &lt;STYLE type="text/css"&gt;
  #Nav a{ position:relative; display:block; text-decoration: none; color:black; }
  Body td{font-Family: Arial; font-size: 12px; }
  &lt;/style&gt;
  </code></pre>