按下后退按钮时,iPhone safari 要求确认再次提交表单

发布于 2024-11-18 00:11:45 字数 152 浏览 9 评论 0原文

我有一个表格。当我单击提交按钮时,表单将被提交,结果将加载到下一页中。在此页面中我有一个超链接。单击该超链接后,我将转到另一个页面。此时,如果我单击浏览器的“后退”按钮,我会收到是否应该提交表单的确认。我如何禁用它?我将结果存储在 sessionStorage 中,因此不需要再次提交表单。

I have a form. When I click on the submit button the form is submitted and result is loaded in the next page. In this page I have a hyperlink. On click of that hyperlink, I am going to another page. At this point if I click 'Back' button of the browser, I get a confirmation whether I should submit the form or not. How do I disable this ? I am storing results in sessionStorage so I do not need to submit form again.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦在夏天 2024-11-25 00:11:45

使用 PRG 模式,可以描述为:

Never show pages in response to POST
Always load pages using GET
Navigate from POST to GET using REDIRECT

参见 http://en.wikipedia.org /wiki/Post/Redirect/Get 以及来自那里的链接

Use the PRG pattern, which can be described as:

Never show pages in response to POST
Always load pages using GET
Navigate from POST to GET using REDIRECT

See http://en.wikipedia.org/wiki/Post/Redirect/Get and links from there

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文