title: JavaScript: detect the moment when window is starting to change location
body: <p>I'm trying to detect the exact moment when the page leaves its current location and begins loading of a new one: immediately after clicking on a link or pressing "submit" or any other way.</p>
  
  <p>I'm aware of "onload" event and several ways to make use of it, but that's not what I'm looking for: plenty of time can pass between 1) clicking on link and 2) firing "onload" event and I need to detect the moment after 1).</p>