title: Javascript know when new page loading
body: <p>Is it possible for javascript to detect when a link is being followed and the page is loading in a new page? Essentially when the new page is coming in?</p>
  
  <p>I know there is the ability to detect onLoad for the document but this is not on the loading in but when the page is done and the new page is coming in.</p>
  
  <p>Use case would be for example, html page loads up entirely. Users views for some time and it has been fully loaded for minutes, then user clicks on an a href link to go to a new page. When the user clicked that link, then immediately gray out the entire page and continue to follow the link to the new page. I do not want to monitor the click action but actually monitor the document or browser state. (because there could be so many ways in which the page location could change not just a href links) Would this be possible?</p>