I am trying to stop browser back button but my code is not working when click back button it can directly going back how can i do this i am calling ajax not using any form type tag
<script type = "text/javascript" >
function preventBack() { window.history.forward(); }
setTimeout("preventBack()", 0);
window.onunload = function () { null };
</script>
I have separate .js files i added in that document.ready function() but it's not working