Where Did You Come From
browser tricks 1997 still worksPrints the page the visitor clicked through from.
In 2026: Works, but it is empty far more often than it used to be. By default a browser now sends only the origin and not the full path on a cross-origin click, and nothing at all when an HTTPS page links to an HTTP one.
Where it came from: Netscape JavaScript 1.0 document.referrer, 1996. MDN ↗
<script language="JavaScript">
if (document.referrer && document.referrer.length) {
document.write("Thanks for coming over from <b>"
+ document.referrer + "</b>!");
} else {
document.write("Welcome! Did you bookmark me? :)");
}
</script>