Skip to content

Instantly share code, notes, and snippets.

@arif98741
Created December 6, 2022 06:26
Show Gist options
  • Save arif98741/e1f79430b24eba74111a12dfffd665ad to your computer and use it in GitHub Desktop.
Save arif98741/e1f79430b24eba74111a12dfffd665ad to your computer and use it in GitHub Desktop.
No Back
<html>
<head>
<title>Disable Back Button in Browser - Online Demo</title>
<style type="text/css">
body, input {
font-family: Calibri, Arial;
}
</style>
<script type="text/javascript">
window.history.forward();
function noBack() {
window.history.forward();
}
</script>
</head>
<body onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">
<H2>Demo</H2>
<p>This page contains the code to avoid Back button.</p>
<p>Click here to Goto <a href="noback.html">NoBack Page</a></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment