Document.referrer script working in Firefox but not IE

I'm trying to create a simple script to verify the referrer URL, then if the referrer URL is what I specify display the content.  So far this script works fine in Firefox, but does not seem to work in IE.

(linkaccess.html)
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>test</title>
<script>
if (document.referrer != "http://www.domain.com/linksource.html"){
      alert ("cannot find link")
      location.href = "protect.html";
      }
else {alert ("found it hurray")}
</script>
</head>

<body>
test
</body>

</html>

(linksource.html)

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>test</title>
</head>

<body>
<a href="linkaccess.html">test</a>
</body>

</html>

(protect.html)

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>test</title>
</head>

<body>
You don't belong here
</body>

</html>
deek22Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZvonkoSystems architectCommented:
document.referrer  does not work on local file system.
And it is better to check the referrer on server side before responding to request with a page but with a response.redirect

The scripting on browser side is NOT realy a protect.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
deek22Author Commented:
Thanks for the pointer :  I used this link to help protect my page:

http://blogs.msdn.com/lisawoll/archive/2005/06/24/432429.aspx


Thx
0
ZvonkoSystems architectCommented:
Why the grading B?
0
deek22Author Commented:
Well, I guess a Grade A would have been a more comprehensive answer with maybe some links to help understand the response.redirect concept.  Please forgive me if I sound a bit picky.

I greatly appreciate your help,


0
ZvonkoSystems architectCommented:
No problem, it is your question and your opinion.
But be aware that my opinion also changes depending on feedback I get ;-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.