manick Posted April 13, 2006 Share Posted April 13, 2006 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 More sharing options...
scott100 Posted April 13, 2006 Share Posted April 13, 2006 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 More sharing options...
manick Posted April 13, 2006 Author Share Posted April 13, 2006 ahhh!! that makes sense now, thanks scottNick Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now