
Am doing a web application in that how to disable browser back button using java script?

Hi Ravi,
To disable back button of your browser, place the below script in the header section(
) of your jsp/html page.<script type="text/javascript">
function disableBackButton()
{
//location.href("logout.html");
}
if(window.history.forward(1) != null)
window.history.forward(1);
</script>
After that you can call the method "disableBackButton()" where ever you want in your page as shown below:
<a href="logout.jsp" onClick="cl();" >Logout</a>
Hope this will help.
Thanks & regards, Sarath Kumar Sivan

<script>
if(window.history.forward(1) != null)
window.history.forward(1);
</script>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.