Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get referer URL when using Javascript

Status
Not open for further replies.

shitalv

MIS
Oct 18, 2002
2
CA
Hello,

Scenario:
I am creating an email application that would send just the "link to the page" to the recipients. I have a hyperlink on the main window. When clicked, this opens a pop up window with a form that takes all the information. It also has a hidden text box that stores the referer URL (i.e. of the main window).

Problem:
When I use following simple html code on the main window to open the pop up window:
<a href=&quot;emailForm.jsp&quot; target=&quot;_blank&quot;> and then on my emailForm.jsp I have <input type=&quot;hidden&quot; value=<%= request.getHeader(&quot;referer&quot;)%>> everything works fine.

Since I want window with no bars, I use Javascript on main window to pop up emailForm.jsp (i.e. < href=window.open(emailForm.jsp, id, features)) and when I use <input type=&quot;hidden&quot; value=<%= request.getHeader(&quot;referer&quot;) %>> then the value of the referer URL turns out to be &quot;null&quot;.

Can anyone tell me how I can use the Javascript to open a popup window and then get the referer URL on the pop up window.
 
Read this: thread216-381656
I posted there some text about referrer that explains the limitations of it's use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top