禁用浏览器上的后退按钮 [英] Disabling Back button on the browser

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

问题描述

我正在编写一个应用程序,如果用户回击,它可能会重新发送相同的信息并弄乱数据的流动和完整性.如何为启用和不启用 JavaScript 的用户禁用它?

I am writing an application that if the user hits back, it may resend the same information and mess up the flow and integrity of data. How do I disable it for users who are with and without javascript on?

推荐答案

遗憾的是,这是不可能的.但是,请考虑您的应用程序导航模型.你在使用 Post/Redirect/Get PRG 模型吗?http://en.wikipedia.org/wiki/Post/Redirect/Get?

It's not possible, sadly. However, consider your applications navigation model. Are you using Post/Redirect/Get PRG Model? http://en.wikipedia.org/wiki/Post/Redirect/Get?

此模型比 Postback 模型对返回按钮更友好.

This model is more back button friendly than the Postback model.

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

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