|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is there a way to disable the back button on a browser.
|
|
#2
|
|||
|
|||
|
No.
You can use the JavaScript function location.replace() to prevent your pages from being added to the window's history object, but you can't disable Back. <A href='javascript:self.document.location.replace("nextfile.html");'> Click here! </A> Then when the user gets to nextfile.html, he or she can't use Back to get to previousfile.html. --Chris |
|
#3
|
|||
|
|||
|
You can also disable it by leaving from a dummy page immediately to the real page. When users try to go back, they keep getting immediately pushed forward again.
Keep in mind that it is very user-unfriendly to do this except in very special circumstances. <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> <script language="JavaScript" type="text/javascript"> <!-- setTimeout ("leave()", 100); function leave() { document.location="http://129.81.84.119/"; } //--> </script> [/quote] |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Disabling the Back button |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|