We help IT Professionals succeed at work.

GETTING THE REFERER URL

bostonroxx
bostonroxx asked
on
How do I get the referer URL in all cases in Javascript?  I need example code please.  I am trying the ASP
<%
response.write request.servervariables("http_referer")
%>

Does not work.  
Thanks.
Comment
Watch Question

BRONZE EXPERT
Top Expert 2005
Commented:
This should do it:

document.write( document.referrer )

Commented:
Please note that if the page is accessed via code, the referrer returns no value!
BRONZE EXPERT
Top Expert 2005

Commented:
BostonRoxx,

Were any of the comments above helpful? If so, please select one as an answer.

Fritz the Blank

PS, whereabouts in Boston?
Admin notified of User neglect. Force-accepted by
Netminder
CS Moderator
BRONZE EXPERT
Top Expert 2005

Commented:
Thank you Netminder!

Fritz the Blank

Explore More ContentExplore courses, solutions, and other research materials related to this topic.