open.window referrer

S

SuneH

If a page is opened by open.window, I can't track from which page with
document.referrer.
Is there a way to to that?
 
D

David Mark

If a page is opened by open.window, I can't track from which page with
document.referrer.
Is there a way to to that?

if (this.opener && !this.opener.closed)
{ alert(this.opener.location); }
 
S

SuneH

if (this.opener && !this.opener.closed)
{ alert(this.opener.location); }

ok, but it is my tracker that won't register the referrer:
ref=""+escape(top.document.referrer)

What must I write to get that?
 
S

SuneH

I don't follow you.

No surprise, I will try to write it better:

If a page is opened with window.open
and a guest click on a link in that window
there is apparently no referrer.
The referrer is empty.
Is there a way to get the referrer?
I try with top.document.referrer and document.referrer.




there is apparently no re
 
D

David Mark

No surprise, I will try to write it better:

If a page is opened with window.open
and a guest click on a link in that window
there is apparently no referrer.
The referrer is empty.
Is there a way to get the referrer?
I try with top.document.referrer and document.referrer.

there is apparently no re

You seem to have trailed off. Anyway, if you navigate to a new page
in the popup window, document.referrer should point to the previous
page. What browser are you using? Can you post a test case that
illustrates the problem?
 
S

SuneH

You seem to have trailed off. Anyway, if you navigate to a new page
in the popup window, document.referrer should point to the previous
page. What browser are you using? Can you post a test case that
illustrates the problem?

Right, there's no problem from opened window to the next pages.

Just checked it again, it's only IE6 that doesn't work ok,
FF is ok!
 
D

David Mark

Right, there's no problem from opened window to the next pages.

Then I don't understand your second explanation of the problem.
Just checked it again, it's only IE6 that doesn't work ok,
FF is ok!

Can you post a test case or link?
 
S

SuneH

Then I don't understand your second explanation of the problem.


Can you post a test case or link?

Yes:
<a href="#"
onClick="window.open('clamps.html','clamps','left=150,top=10,width=550,height=550');
return false;">clamps</a>

It doesn't matter if: <a href="#" or <a href="clamps.html"

I want the document.referrer of the opened window.

I can get the ref in IE6 with this:

if (window.opener) ref = window.opener.location.href;

But then I need the lastIndexOf('/') the ref ... but how?
 
S

SuneH

On Wed, 17 Oct 2007 00:52:45 -0700, David Mark

I want the document.referrer of the opened window.

I can get the ref in IE6 with this:

if (window.opener) ref = window.opener.location.href;

But then I need the lastIndexOf('/') the ref ... but how?

Found out this.

if (window.opener){ ref = window.opener.location.href;
zz = ref.lastIndexOf("/")+1;
refer = ref.substring(zz,zz+15)
ref = ""+escape(refer);
}

But I can't make the tracker to eat it.

With FireFox it works without this "workaround"
I know that I can write it shorter, but I splitted it up to see if I
could find the error.

BTW: What does ""+escape do ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,150
Messages
2,570,853
Members
47,394
Latest member
Olekdev

Latest Threads

Top