Disable Browser Back Button Javascript

Javascript Disable Browser Back Button is used to prevent user from navigating to the previous page by clicking on the back button.

Features

  • Completely disables the back button of a browser.
  • User cannot attempts to back up within your site.
  • It also disables alt + back arrow.
  • This javascript code supports all kind of browsers.

Preview

Downloads

JavaScript


<!-- Script by hscripts.com -->

<script type="text/javascript">

window.history.forward(1);
function noBack(){
window.history.forward();
}
</script>


<!-- Script by hscripts.com -->


HTML Code


<!-- Script by hscripts.com -->

<body onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">
<center>
<a href="test.php"><H2>HIOX</H2></a>
<p><b>When ever you have to be click <b>HIOX</b>,the back button will be disabled.</b></p>
</center></body>
<div style="font-size: 10px;color: #dadada;" id="dumdiv" align=center>
<a href="https://www.hscripts.com" id="dum" style="text-decoration:none;color: #dadada;">©</a></div>

  • Release Date - 21-12-2010
  • Get free version without ©copyright link for just $10/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Create page1 and copy the javascript code.
  • Call "noBack()" function using onload event in your javascript code.

    <body onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">

  • Create page2 and give link for page2 in page1.
  • If you click link on page1, the link goes to page2 and disables the back button of page2.

License

Related Scripts

Free Javascript Scripts


Ask Questions

Ask Question