I think you are trying to access the address bar of a clients browser AFTER it has left your website?
That won't be possible unless you open the site in an iframe
and then access the child frame with javascript.
You can do that easily by changing the target of your link, e.g.
Change this:
<a href="http://thewebsite.com/">Go to website</a>
To this:
<iframe name="tokenFrame" id="tokenFrame" width=1 height=1 frameborder=0> </iframe>
<a href="http://thewebsite.com/" target="tokenFrame">Don't go to website</a>
Then in javascript, after the page has changed to the one with the token:
var url = document.getElementById("tokenFrame").src
Or something similar to get the location e.g.
var frame = document.getElementById("tokenFrame");
var url = frame.top.location.href;
Or
var url = top.tokenFrame.location.href;
Finally parse the URL to get the value