Welcome to WebmasterWorld Guest from 54.144.107.83

Forum Moderators: open

Message Too Old, No Replies

javascript redirect and back buttons.

how to overcome back button problem when using redirect?

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

Junior Member

10+ Year Member

joined:June 23, 2003
posts:145
votes: 0


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.
7:13 am on June 24, 2003 (gmt 0)

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 0


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")

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

Junior Member

10+ Year Member

joined:June 23, 2003
posts:145
votes: 0


Great. Thanks. I will give it a whirl.
11:38 am on June 24, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:June 23, 2003
posts:145
votes: 0


Thanks again. it works a treat.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members