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

disable the back button of a browser

Status
Not open for further replies.

abyinsydney

Programmer
Feb 17, 2004
99
AU
greetings fellow citizen
Could you let me know how to disable the back button of a browser

aby
 
Is this for a in house (with in your company) application?

___________________________________________________________________

The answer to your ??'s may be closer then you think. faq333-3811
Join the Northern Illinois/Southern Wisconsin members in Forum1064
 
While there is no way to fully disable the back button the following code will get you close. You place this code on the page that you don't want them to be able to back up to (if user is on 'page A' and then goes to 'page B' and you do no want them to be able to use the back button to get to 'page A', place this code at the top of 'Page A'

<script language="JavaScript"><!--
javascript:window.history.forward(1);
//--></script>

 
aby :

mbiro is quite right. here is something to prove his point :

aaa.html :
Code:
<html>
<body onLoad="javascript:window.history.forward(1);">
hello
<a href="bbb.html">here</a> aaa
</body>
</html>

bbb.html :
Code:
<html>
<body onLoad="javascript:window.history.forward(1);">
<a href="ccc.html">here</a> bbb
</body>
</html>

ccc.html :
Code:
<html>
<body onLoad="javascript:window.history.forward(1);">
<a href="ccc.html">here</a> ccc
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top