Solved

Manipulating Navigator's History Object

Posted on 1997-05-23
3
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

623 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