To help better explain my Question, here is what i have:
I am using a Precoded service, on it i have access to the Template HTML Files Only.
The URL to the Login page is : DynamicPage.aspx?Site=Mysite&WebCode=LoginRequired
The Main site URL would look like : DynamicPage.aspx?Site=Mysite&WebCode= or DynamicPage.aspx?Site=Mysite
What i need is a JavaScript I could put into the main header template file that would view "WebCode" And depending on whats entered redirect to a certain page.
I got from "Sitifensys" a code
Sitifensys
if (window.location.href!="foo.bar/login.php") window.location.href="login.php";
The problem with this code is even when i go to the main page it still redirects me to login.php which i do not want it to. I need this code to Read the "WebCode" If it is "LoginRequired" Redirect to "Login.php" else if redirect to "Test.php"
Hope this explanation is a bit better.
Just as answered earlier, you should add a window.location.href=”somepage” somewhere.
Some where in your script :
This doesn’t need to be in a listener for the page load event.
EDIT :
Regarding your new descriptionn I would use (but would not recommend;)) something like :
Hope this will help.