开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜