• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. Page Navigation Techniques > 10.2. Keeping a Page Out of the Browser Histor...

Keeping a Page Out of the Browser History

NN 3, IE 4

Problem

You want to remove the current page from the browser history so that the Back button does not take the user back to the current page after a script navigates to some other page.

Solution

Navigate to the next page via the location.replace( ) method:

location.replace("http://www.megacorp.com/indexDHTML.html");

Discussion

The capability of keeping a page out of the browser’s history can come in handy when your site contains a page that include automatic forwarding under script control. Recipe 5.10 is a typical situation that benefits from keeping a temporary page out of the history. If the user reaches the real home page, a press of the browser’s Back button normally brings the user back to the temporary page, and the user is essentially trapped in an infinite loop from which escape can only occur by going forward.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint