Jump to content

document referrer keeps referring!!


manick

Recommended Posts

Hi all,I have the following basic script for document referrer, and regardless of where the page has been loaded from it refers me back to the index page, can someone please tell me what i m missing!!function checker(){var x=document.referrer;if ((x=="main.html")||(x=="wishlist.html")||(x=="prodblank.html")||(x=="form.html")||(x=="product1.htm")) { return true} window.location="index.html";return false} Many thanks in advanceNick Trenam

Link to comment
Share on other sites

That's because the window.location wasn't part of the if statement, it always executes regardless, put it in an else clause.function checker(){var x=document.referrer;if ((x=="main.html")||(x=="wishlist.html")||(x=="prodblank.html")||(x=="form.html")||(x=="product1.htm"))  {     }  else window.location="index.html";}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...