Debt Consolidation - Submit articles - Wordpress Themes - Debt Consolidation - Free Animated Greetings

PDA

View Full Version : Referrer in javascript


Ankit
Mar 18th 2006, 4:01 am
Hi

Below javascript codes is not working as i am unable to get referrer correctly with the following codes.

if(top.frames.length==0)
{
abc=document.referrer;
}
else
{
abc=top.document.referrer;
}

How could i get referrer correctly if I put above codes in frame or with out frame pages.
abc=parent.document.referrer; is also not working.

Thanks

Ankit

Slapyo
Mar 20th 2006, 7:47 am
Do you have a sample page that we can look at? document.referrer is correct.

if (document.referrer != '') document.write('Thanks for visiting from ' + document.referrer);

Ankit
Mar 20th 2006, 10:26 pm
web page is dynamic some times page with frame comes & some times with out frame.

I want to get referrer using single javascript code.

In frame document.referrer does not work correctly..

OJASR

Slapyo
Mar 21st 2006, 7:25 am
Have you tried, top.{framename}.document.referrer ?

Ankit
May 5th 2006, 5:07 am
thanks for your relpy.

not working..

Actually I am using hitslog purpose.

I don't know in which frame, user will place code.

how i willl get frame reference for main page referrer.