How to disable back,forward and Refresh functionality in browser?
Can anyone help me to disable browser back,forward, back button and right click menu functionality using JavaScript or JQuery? I have tried disabling the back button like this:
function disableBackButton() {
window.history.forward();
}
setTimeout("disableBackButton()", 0);
I have called this function in the Body onload
event. I have a doubt that where we need to put this code in the Calling page or 开发者_Go百科Called Page.Suppose i have two pages like this FirstPage.aspx
and SecondPage.aspx
. When I navigate from the First Page to Second Page when I click back button of the browser it should not go to FirstPage.aspx
.
Have a look at A Thorough Examination of "Disabling the Back Button."
精彩评论