I know this is a very old thread but I noticed that wired420 code has a problem, it supports only one single link per page, because of that one line they replaced.<br>
That new line of code should be:
newLocation = $(event.target).find('a').attr("href");
or
newLocation = $(this).find('a').attr("href");
Actually, on IE9+ and all other browsers there’s no need for jQuery:
newLocation = event.target.querySelector('a').href;
or
newLocation = this.querySelector('a').href;