Microsoft KB Archive/164496

{|
 * width="100%"|

FIX: document.referrer Property Returns Incorrect Value

 * }

Q164496

-

The information in this article applies to:


 * Microsoft Internet Explorer (Programming) versions 3.0, 3.01

-

SYMPTOMS
The referrer property of the document object should contain the calling page's URL. In Internet Explorer version 3.0 and 3.01, the referrer property contains the current page's URL.

CAUSE
This has been confirmed to be a problem with the object model of Internet Explorer.

RESOLUTION
To work around this problem, you can use script code to pass the information in a cookie.

The following two files, Alpha.htm and Comments.htm illustrate how to work around this problem. Alpha.htm uses a cookie named referrer to keep track of the calling page's URL. It passes this cookie to Comments.htm, which then displays the referrer.

  ====File Alpha.htm====   New Page  function clicked { document.cookie='referrer='+ document.location + '; path=/'; }    

Comments 

  ====File Comments.htm==== <pre class="CODESAMP">    New Page</TITLE> <script langauge="Javascript"> document.write("<BR><BR>cookie=" + document.cookie ); </HEAD> </BODY> </HTML>

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem has been fixed in Internet Explorer 4.0.

Steps to Reproduce Behavior
The following two pages illustrate the problem. Page1.htm calls Page2.htm, which displays the referer property.

<pre class="FIXEDTEXT">  ===Page1.htm=== <pre class="CODESAMP">   Page 1</TITLE></HEAD>  Comments</a><BR> </BODY> </HTML> <pre class="FIXEDTEXT">  ===Page2.htm=== <pre class="CODESAMP">   Page 2</TITLE> <script langauge="Javascript"> document.write(document.referrer); </HEAD> </BODY> </HTML> Additional query words:

Keywords : kbprogramming

Issue type : kbbug

Technology : kbIEsearch kbAudDeveloper kbSDKIESearch kbSDKIE300 kbSDKIE301