Welcome to WebmasterWorld Guest from 23.22.250.113

Forum Moderators: open

Message Too Old, No Replies

javascript redirect and back buttons.

how to overcome back button problem when using redirect?

     

stevenjm

6:17 am on Jun 24, 2003 (gmt 0)

10+ Year Member



Hi, new here with a question:
trying to find out if anyone knows of a way to overcome the back button problem that arises when using a javascript redirect to keep an orphaned page in its frameset? Is there a more sophisticated javascript to use than a simple redirect that will not present the same problem? ie person comes to site via an orphaned page it calls parent frameset. then hits back button which is obviously calling orphaned page again which contains redirect again essentially trapping them from going back to the site they came from if they came via an orphaned page. Trying to find a way without inserting a javascript back button on the page. Thanks.

tedster

7:13 am on Jun 24, 2003 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Using location.replace() instead of simply re-assigning the location or href should do it.

The location.replace() method does just what it sounds like, it REPLACES the current location's address in the history instead of adding a new one. That leaves the back button in an intuitive state for any kind of quick redirect. Handy in your situation, browser or resoilution sniffing, etc.

location.replace("alternate_page.html")

stevenjm

10:11 am on Jun 24, 2003 (gmt 0)

10+ Year Member



Great. Thanks. I will give it a whirl.

stevenjm

11:38 am on Jun 24, 2003 (gmt 0)

10+ Year Member



Thanks again. it works a treat.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month