Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FAQ Topic - How can I disable the back button in a web browser? (2012-05-26)

4 views
Skip to first unread message

FAQ server

unread,
May 25, 2012, 7:00:03 PM5/25/12
to
-----------------------------------------------------------------------
FAQ Topic - How can I disable the back button in a web
browser?
-----------------------------------------------------------------------

You can't. The browser's history cannot be modified. However, you
can use `self.location.replace(url);` in some browsers to replace
the current page in the history.

<URL: http://msdn.microsoft.com/en-us/library/ms536712%28VS.85%29.aspx>
<URL: http://docs.sun.com/source/816-6408-10/location.htm#1194240>


The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/

--

The sendings of these daily posts are proficiently hosted
by http://www.pair.com.

Luuk

unread,
May 26, 2012, 3:36:55 AM5/26/12
to
On 26-05-2012 01:00, FAQ server wrote:
> -----------------------------------------------------------------------
> FAQ Topic - How can I disable the back button in a web
> browser?
> -----------------------------------------------------------------------
>
> You can't. The browser's history cannot be modified. However, you
> can use `self.location.replace(url);` in some browsers to replace
> the current page in the history.
>
> <URL: http://msdn.microsoft.com/en-us/library/ms536712%28VS.85%29.aspx>
> <URL: http://docs.sun.com/source/816-6408-10/location.htm#1194240>
>
>
> The complete comp.lang.javascript FAQ is at
> http://jibbering.com/faq/
>

How does:
"The browser's history cannot be modified."
relate to:
"to replace the current page in the history."

If history cannot be modified, it also should not be possible to replace
an item in history?

Evertjan.

unread,
May 26, 2012, 4:57:41 AM5/26/12
to
L'histoire se répète, parbleu!

Niccolò Machiavelli explained this was considered not very usefull
in his age and in any other, because some points of history can be
unscrupulously overwritten, or not even filled faithfully:

"On dit et cela se répète sans beaucoup de réflexions, que les traités
sont inutiles, puisqu'on n'en remplit presque jamais tous les points, et
qu'on n'est pas plus scrupuleux là-dessus dans notre siècle qu'en tout
autre."

<http://machiavelli.letteraturaoperaomnia.org/critica/machiavelli_critica
_l_antimachiavel.html>

So do like Niccolò, never trust browsers, even non-IE, to do as
promissed.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
0 new messages