title: Automatically scroll to bottom as the page loads
body: <p>I have a php script that shows a log of its actions as the script proceeds. The log is getting quite long, up to the point where it will echo its information past the bottom of the page, adding a scrollbar to the page.</p>
  
  <p>If I want to see the rest of the log, I have to manually scroll down. I can make the page go to say... process.php#bottom but I can't just insert a <code>&lt;a name="bottom" /&gt;</code> after each log item and expect the browser to keep jumping to the bottom, can I?</p>
  
  <p>Is there a a javascript function, or other easy method, that will automatically scroll the page to the bottom as soon as this isn't the case?</p>
  
  <p>I don't mind if it overrides the user's ability to scroll, as the script will redirect back to the main script after 3 seconds at the end anyway.</p>
  
  <p>I do not necessarily need a full script, if you just have pointers, but those that provide a full working script will obviously get their answer accepted over those that just give pointers.</p>
  
  <p>If you don't have an idea of what I mean by the log, you can use the following script to simulate what my script does:</p>
  
  <pre><code>&lt;?php
  for( $iLineNumber=0 ; $iLineNumber &lt;100 ; $iLineNumber++ )
  {
      echo $iLineNumber , ' - This is a test. &lt;br /&gt;';
      sleep(1);
  }
  ?&gt;
  </code></pre>
  
  <p>Basically, as the script loads and sleeps every second, when it hit the bottom of the page, it should automatically scroll down every second.</p>