开发者

Does anyone know how to block browser back button? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Disable browser's back button

i have one button on page开发者_如何学Go on that button click event page will redirect on the next page now i click on the browser back button but i want to restrict browser back button for some security purpose

does any one know how to block browser back button so that page can not redirect to previous page?


Do not disable expected browser behaviour and you can handle the possiblity at your end, but if you really want to do so, there is one work around here...

Just put this javascript on the html section of aspx page above head section.

This causes every back to return with a forward.

<script type = "text/javascript" >
function disableBackButton()
{
window.history.forward();
}
setTimeout("disableBackButton()", 0);
</script>


Open the webpage in a popup window rather than normal window. So, that you can restrict the popup window from displaying buttons, menus, status and other features.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜