The referrer property

The referrer property holds the value of the URL the viewer was on before arriving at your page.
This is very useful information but the viewer can come to your page from a bookmark which will give nothing (undefined) as a value.

window.alert ("You come from " + document.referrer);

Leave a Reply