Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect Page

Status
Not open for further replies.

robert89

Technical User
Nov 19, 2003
125
CA
Hi there,
We want to creat a redirect page, with the time set to 0. This I know how to do. I understand that doing this will catch the visitor in a loop should they hit the back button from the page they have been redirected to. Is this the case and does anyone know of a work around.
Scenario:
Visitor is redirected from page "A" to page "B". They hit back button, and go back one beyond "A". Is there a piece of javascript I can put in head of "B".

Any other ideas also welcomed.
Thanks
Bob
 
Yes, it will put the visitor into a sort of "loop", but it's not that hard for the visitor to get around it. They can either click the back button twice close together (time-wise) or they can close the tab (real browsers do have tabs) that the page is on and open a new one (same can be done with browser window).

You may be able to do something with document.history, but I'm not sure about that.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Hi Bob,

I guess this should do it for you:
Code:
<HTML>
<HEAD>
  <TITLE>Page 1</TITLE>
</HEAD>
<BODY onload="window.location.href='page2.html'">
  <H1>Page 1</H1>
</BODY>
</HTML>
... and
Code:
<HTML>
<HEAD>
  <TITLE>Page 2</TITLE>
</HEAD>
<BODY>
  <H1>Page 2</H1>
  <BUTTON onclick="history.go(-2)">BACK</BUTTON>
</BODY>
</HTML>
Does this help?

Regards


Jakob
 
Hi Jakob,
Didn't thought of a redition of your solution, only problems is that 95% our the visitors would enter the page from somewhere else. So having the history.go(-2) would please 5% and confuse 90%.
Thanks for the idea though, I'll keep in it in mind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top