开发者

How to disable back,forward and Refresh functionality in browser?

开发者 https://www.devze.com 2023-03-29 14:09 出处:网络
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:

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."

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号