火狐:如何重新加载窗体*没有*缓存用户输入? [英] Firefox: How to reload form *without* caching user-input?

查看:182
本文介绍了火狐:如何重新加载窗体*没有*缓存用户输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您拥有包含HTML表单的页面时,刷新/重新加载页面或使用后退按钮,Firefox很善良,可以重新填充您输入的内容,然后再导航。

问题:

对于某些使用情况,这是不是所需的功能。幸运的是,如果您愿意使用下面的一个无重新缓存选项,则可以采用这种方式:

 重绘没有缓存;;按CTRL + F5 
不重新缓存;;在按住SHIFT
的同时按下Reset按钮不进行缓存;从地址栏中删除地址,将其粘贴回地址栏,按ENTER键
用缓存重绘;;按F5

问题是,并非所有的用户都知道这些选项,有些只是想要一个简单的Reset

问题:



有没有办法让Firefox做一个没有缓存重绘的方式,让用户只需用鼠标点击一个按钮, 不得不使用键盘?

解决方案

为了完整起见:

pre > <脚本>
document.FORMNAME.reset()
< / script>

将表单重新命名为 FORMNAME 每次刷新页面。


BACKGROUND:

When you have a page that includes an HTML form, and you refresh/reload the page or use the back button, Firefox is kind enough to repopulate your inputs with what was entered before you navigated away.

PROBLEM:

For some use-cases, this is not the desired functionality. Fortunately, there are ways around this behavior if you are willing to use one of the "redraw without caching" options below:

redraw without caching  ;; Press CTRL+F5 
redraw without caching  ;; Press form "Reset" button while holding SHIFT
redraw without caching  ;; Cut the address from the address bar, Paste it back into the address bar, press ENTER
redraw with caching     ;; Press F5 

The problem is, not all users know these options, and some just want a simple "Reset" button that they can click on with the mouse without having to use the keyboard.

QUESTION:

Is there a way to get Firefox to do a "redraw without caching" in a way that lets the user simply click on a button with the mouse, and not have to use the keyboard?

解决方案

For the sake of completeness:

<script>
document.FORMNAME.reset()
</script>

It resets the form with the name FORMNAME on every reload of the page.

这篇关于火狐:如何重新加载窗体*没有*缓存用户输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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