2

I am using Internet Explorer to run some code where I use javascript code window.open. Here is a sample code below. This is written in a page r_test1.asp

<script type="javascript">
window.open('r_test2.asp');
</script>

A window open naming r_test2.asp and there I am trying to get the referer. The code of page r_test2 is

response.Write(request.ServerVariables("HTTP_REFERER"))

The problem is I get referer in mozilla or chrome but not in Internet explorer which I need it badly there

polin
  • 2,745
  • 2
  • 15
  • 20

1 Answers1

1

Internet explorer indeed does NOT pass a referer when you use the window.open event.

A nice alternative solution (to mimick a click on a hyperlink so IE does set the referer) has been previously posted here on StackOverflow:

JavaScript window.location does not set referer in the request header

Community
  • 1
  • 1
AardVark71
  • 3,928
  • 2
  • 30
  • 50
  • I've found it but thanks though. You are right and thanks for helping. But I still don't understand why there is a negative voting in my question. Is it not worth of a question? – polin Oct 04 '12 at 08:07
  • the question was clear enough for me, so I also don't understand the downvote – AardVark71 Oct 04 '12 at 08:18