Friday, October 2, 2009

Disable browser's back button ?

you can disable the back button, they say.

didn't test the code yet, will be back with feedback





< script type="text/javascript">

function noBack(){window.history.forward()}
noBack();
window.onload=noBack;
window.onpageshow=function(evt){if(evt.persisted)noBack()}
window.onunload=function(){void(0)}

< / script>






you can feedback also :)

1 comment:

Anonymous said...

This will not disable the back button but will always take the user to the forward most page in history. I did something similar as a proof of concept and it worked as expected.