HOME | ABOUT | SEARCH | CODE | GRAPHIX | MISC | SITEMAP | CONTACT

 

Disabling The Back Button

This is incredibly simple:

Replace your <body> tag with:

<body onload="javascript: history.go(1);">

and the page will attempt to go forwards when it loads, this means a user will be unable to go back to a page if all your pages have this specified on them. It will always end up on the last item in the history of that browser window.

There is also this method:

define a link like this: <a href="javascript: window.location.replace('page2.htm');">Next Page</a>

and back will not take them to the page that link was at, it will take them to the previous one (if there is one). If the linking page is the only one open in a browser window, the back option simply won't be available as the location REPLACES the current location.

If the user comes from another site, there is no way you can stop them clicking back in some manner or form to get back to that site - only that site's coding can do that, not yours.

<<< More Code

 

 

By John Baldock - AKA Bonno

More Sites by John Baldock