How to Disable Browser Back Button using JQuery?
Comment (0)
Admin
How can we disable browser forward and back button using jquery or javascript that is lead topic. we can use window.history.pushState for restrict back button of browser in jquery. we can disable back button in browser using jquery in php or any mvc framework like laravel, codeigniter etc.
<!DOCTYPE html>
<html>
<head>
<title>How to disable browser back button using Jquery? - nijwel.xyz</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
<button>click on browser back button</button>
</body>
<script type="text/javascript">
$(document).ready(function() {
window.history.pushState(null, "", window.location.href);
window.onpopstate = function() {
window.history.pushState(null, "", window.location.href);
};
});
</script>
</html>
Comments (0)
Your Comment