Welcome to WebmasterWorld Guest from

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)

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.


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.



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

10+ Year Member

Great. Thanks. I will give it a whirl.


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