禁用浏览器"返回]按键 [英] Disable browser "Back" button

查看:122
本文介绍了禁用浏览器"返回]按键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能在一个HTML页面禁用浏览器的后退按钮?
我不希望创建JavaScript的窗口,以避免表现出任何的工具栏等。
在常规的HTML页面,有没有什么办法来禁用工具栏上的后退按钮?

how can I disable the browser's "Back" button in a HTML page? I do not want to create JavaScript window to avoid showing any toolbar,etc. In regular HTML page, is there any way to disable the back button in the toolbar?

感谢

推荐答案

您不能在技术上禁用它,而且你不应该。禁用浏览器的后退按钮会从根本上改变了这是不是你的地方做一个用户的浏览体验。

You can't technically disable it, and moreover you shouldn't. Disabling the back button of a browser would fundamentally change the browsing experience for a user which isn't your place to do.

如果在浏览器回去会为您的应用程序,那么你应该调整你的工作流,以便它没有问题。这样的一个例子是执行POST / REDIRECT / GET模式

If going back in the browser creates problems for your application then you should restructure your workflow so it doesn't. An example of this is implementing the POST/REDIRECT/GET pattern.

更多信息: http://en.wikipedia.org/wiki/Post/Redirect / GET

这篇关于禁用浏览器"返回]按键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆