title: Javascript redirect before the rest of the page is loaded?
body: <p>I am making an iPhone webapp with a login form. Once the user is logged in I am storing some information in an HTML5 DB.</p>
  
  <p>The problem is that every time the app is loaded the <code>login.php</code> page runs and checks if there is some info in the DB, if there is, it redirects to <code>data.php</code>, but in the meantime I see a short buy annoying flash of login.php.</p>
  
  <p>I am placing the code that checks the DB on top of the page with a <code>window.stop()</code> after it, but no luck.</p>
  
  <p>Any point in the right direction will be much appreciated!
  thanks!</p>