Not sure about version support:
I've seen both of these referenced.
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:
document.write('<frame src="given.php?ref=' . document.referrer .'" name="nav" marginwidth="3" marginheight="3" scrolling="auto">' );
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:
document.write("<frameset cols='170,*' rows='*' border='2' framespacing='0' frameborder='yes'>
<frame src='given.php?ref=" + document.referrer +" name='nav' marginwidth='3' marginheight='3' scrolling='auto'><frame src='index.php?pane=right' name='main' marginwidth='10' marginheight='10' scrolling='auto'>
but nothing, I'm thinking maybe that I can't do this because frames have to be in a file with nothing else, so JS cannot do this?
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 :bawling:
This topic is now closed. New replies are no longer allowed.