[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: document.referrer in frames doc



Document.referrer seems to work if you do this:

parent.document.referrer

This refers to the frameset document.  It appears referrer is blank for any
of the frame documents.

-- Gordon
http://gmccomb.com/javascript/

At 08:51 PM 3/19/96 -0500, you wrote:
>I'm asking this again as all the gurus seem to have taken a forced vacation!0
>
>I'm trying to post the referring page in a frame in my document.  Here's the
>snippet:
>
><SCRIPT LANGUAGE="JavaScript">       
>        var referrer = ""
>        referrer = document.referrer
>        if (referrer) {
>             document.write("<br>Referring Page: ");
>             document.write(referrer);
>             document.write();
>        }
></SCRIPT>
>
>If the file is loaded up directly from a link this works just fine, but when
>the file is a frame (named "main" if that helps anyone), referrer is NULL so
>nothing happens.   I've tried referrer= parent.main.document.referrer and
>referrer=parent.top.document.referrer but that doesn't seem to work (both
>return <undefined>)
>
>all help appreciated.  (all flames deserved.)
>
>-- 'liz.
>elizabeth c. miller
>Internet Marketing and Web Design
>maxm consulting
>508 362-5886       
>http://www.oneweb.com/maxm/
>
-- Gordon
http://gmccomb.com/javascript/


--------------------------------------------------------------------
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/