• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

Clearing History of Browser

Hi
I want to make the Browser back button diasable each time a new page is loaded. Basically I think that if there is no history there will be no enabled Back button. How it is possible in IE and Netsacpe.

Thanks in advance
0
pudcs
Asked:
pudcs
1 Solution
 
TTomCommented:
I think the only way you can do something like this is if the new pages are loaded via JavaScript using the "replace()" method.  The JavaScript syntax is:

window.location.replace("URL")

This will change the page and overwrite the current entry in the history.  It will not work for entries typed into the address window, and it is not supported by IE3.

Tom
0
 
nathansCommented:
Are you simply trying to keep people from hitting the back button and getting old data not a fresh page?
0
 
pudcsAuthor Commented:
Possibly YES but I have tested this out , it has some risks that I want to avoid by disabling the Back button.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
TTomCommented:
pudcs:

Your answer to nathans' question was not clear.  You say you have tested this out, but you do not indicate what you have tested.

The question was, "What exactly are your trying to accomplish by disabling the Back button?  Do you want to prevent reloading the page, or is the page a form which might be reloaded with 'stale' data or even reloaded and resubmitted?"

If the issue is one of data, you can solve this quickly by resetting the form when the page loads:

<body onload="document.form.reset()">

My previous comment about replace() will prevent the page from being loaded at all via the Back button.

Tom
0
 
GimpsterCommented:
It is not possible.  Because when you disable the History, the browser does not keep a record of where you have been.  However, when the browser is open, it keeps a sort of "temporary history".  So it is impossible to disable the Back button.  Sorry.
0
 
pudcsAuthor Commented:
I accept the answer but it leaves me from where I start, that it is not possible to disable the Back button of browser by clearing the history of browser.

Thanks anyway
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now