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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to delete the last page in the browser history?

Status
Not open for further replies.

simplyroberto

Programmer
Apr 15, 2005
5
IT
Does anybody know if there is a way of preventing the browser from adding the current page to its history?
I explain: I have a page that keeps loading itself every time the user make changes to it (like deleting a record displayed on the page). Now the user could potentially make several changes and the same page would be loaded several times. If at this stage the user click the browser back button they would see the same page again and again. Is there a way to stop the browser from saving this page to its history either in Java?
Many thanks,
Roberto
 
Code:
location.replace('[URL unfurl="true"]http://www.google.com')[/URL]
Note that if your page needs to submit something every time then this is not going to be possible. However, if you are just navigating from page to page you can use the .replace method to replace the current page in the browser history with a new page.

-kaht

Do the chickens have large talons?
[banghead]
 
You have another alternative: instead of reloading the entire page each time, use an iframe to contain the part that keeps changing, and just reload the iframe. AFAIK the history does not record iframe URLs.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
When I don't want someone to be able to submit a page a second time, but want the original page reloaded, I use an intermediate page that processes that data, then redirects to the original page. That way the processing is done on a separate page, so reloading doesn't duplicate the action.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top