Solved

Manipulating Navigator's History Object

Posted on 1997-05-23
3
227 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now