Solved

Manipulating Navigator's History Object

Posted on 1997-05-23
3
250 Views
Last Modified: 2010-05-18
Is there any way to manipulate the history list???

For example:

After a user goes through a logon screen (HTML0), I have a screen (HTML1) that upon loading (onLoad event) sets the location of the window to a diffent URL (HTML2). The problem is, is if the user clicks the back button, they are taken back to the HTML1 screen (and within a second or so placed right back in HTML2) but I want a single click of the back button to take them to the HTML0 screen where they can logon again.

More specifically:

HTML0 --> HTML1 --> HTML2
  ^---------B-A-C-K---------+

What I am thinking is that once the HTML1 page is loaded, it removes itself from the history list and then proceeds to load the HTML2 page. Therefore if the user clicks the back button, he/she will be taken to HTML0 as desired.

Can this be done???

Thank You
Chris
0
Comment
Question by:Presto
  • 2
3 Comments
 

Author Comment

by:Presto
ID: 1265783
Edited text of question
0
 

Author Comment

by:Presto
ID: 1265784
Edited text of question
0
 
LVL 5

Accepted Solution

by:
icd earned 100 total points
ID: 1265785
No. To quote from the Netscape documentation.

'Elements in the history array are read-only. For example, the statement
history[0]="http://home.netscape.com" has no effect.'

The only way you can do this is to provide your own 'back' button which when pressed will jump back two levels in the history array.

However. If you can use the 'location.replace("URL")' (Navigator 3.0) this will replace the current page with another one ***without putting an entry in the history array***

So, put the link to HTML1 as a location.replace and it will not appear in the history array and your problem is solved (I hope!)


0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question