如何在提交后清理表单中的信息,以便在页面刷新后不显示此错误?
查看图片(来自 chrome):
对话框有文本:
The page that you're looking for used
information that you entered. Returning to that
page might cause any action you took to be
repeated. Do you want to continue?
我不想出现这个对话框。
最佳答案
这个方法对我很有效,我认为最简单的方法是在重新加载页面的 HTML 中使用这个 javascript 代码。
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
关于php - 如何防止 "Confirm Form Resubmission"对话框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6833914/