Have a look at the
document.refferer
http://www.w3schools.com/jsref/prop_doc_referrer.asp[
^]
For example, if I code to may CodeProject profile, click my HomePage icon, this will load up my website in the browser, if I then inspect the page with the browser debugger and put
document.refferer
in the javascript console, it shows me the URL to the codeproject profile page.