Not sure about version support:
I've seen both of these referenced.Code:document.write(location.referrer); document.write(document.referrer);
I'll give those a try and tell you what works.
document.referrer is the magic one!
Muchas Gracias, senor
Just a note that if they get to your site by clicking their favorites or by typing it in the location bar document.referrer will be empty.
True true. Same thing with ASP or probably any language for that fact. Still, most people will be visiting via a search engine for this site.
Cool, just what I wanted to know
Just one thing, if I use frames, the frame won't have the referer will it? Or can I use
OK that doesn't work, could someone tell me how to get it pass it on? I tried this and it doesn't work:
Code:<script> document.write('<frame src="given.php?ref=' . document.referrer .'" name="nav" marginwidth="3" marginheight="3" scrolling="auto">' ); </script>
Code:document.write("<frame src='given.php?ref=" + document.referrer +" name='nav' marginwidth='3' marginheight='3' scrolling='auto'>");
Cheers, but still no luck. I tried removing everything else and putting all that's left in the JS, like:
I'm clicking the link from an entirely seperate page, with nothing but the link.
I was hoping to create a top-refers script, but this method wouldn't work anyway. I wanted it for a site I'm working on, www.board.tk and .tk uses frames to load your site. Of course I've now realised that I don't actually have any control over the frameset page anyway! I need to use a parent.location thing anyway to get out of frames as it plays havoc with cookies and P3P is hard to write. That is why I wanted parent.referrer to work as I could pass that on, but it looks impossible