homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

javascript redirect and back buttons.
how to overcome back button problem when using redirect?

 6:17 am on Jun 24, 2003 (gmt 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 Jun 24, 2003 (gmt 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.



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

Great. Thanks. I will give it a whirl.


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

Thanks again. it works a treat.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved