Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the history entry

Status
Not open for further replies.

ArcAnjel

Programmer
Feb 9, 2005
13
US
Is there some way to specify what URL should be listed in the back button history list when you click on a link?

Thanks!
 
No. But, you can fake up something vaguely similar by doing the following:

Page A = where you are now.
Page B = where you want to pretend they were.
Page C = where your link allegedly will go.

Page A's link actually does a location.replace with Page B's address; Page B is set up in such a way that if (and only if) it comes from Page A it displays nothing but pushes the browser straight on to Page C.

Page A will not exist in the history buffer, but Page B will, even though the user isn't necessarily aware of going there.
 
I figured that was the case... I guess I'm back to square 1, a good site with a small, but annoying, bug.

Thanks anyway.
 
This explanation is a bit long, sorry. I have a index page with an iframe and a nav bar with links to other pages and links to change the content of the iframe. So when I go to one of the other pages then select one of the links that changes the content of the iframe, the iframe is on a different page. So I use a parameter pass to open the open the index page and the pass tells the iframe what page to load. Works perfectly and pretty simple so far.

Here's the issue. I am now on the index page with a parameter pass in the URL and I select a link that changes the iframe content. The iframe content changes but the parameter in the URL still points to a different page. Now when I select a link and then try to go back to the index page, it briefly shows the correct page in the iframe, then immediately replaces it with what was in the URL pass.

I'm not trying to promote my website, but here is the URL so you can see this in action.


I could just make all of the links that target the iframe reopen the page using the parameter pass, but I would like to avoid the screen blip and the added history buffer entries if possible.

You did mention "location.replace". I am not trained as a programmer (I'm actually a mechanical engineer) so this is new for me, but it sounds like it may work.

-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top