Firefox 缓存 textarea 值? [英] Firefox cache textarea value?

查看:31
本文介绍了Firefox 缓存 textarea 值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一个奇怪的问题.在Firefox中打开一个简单的页面,代码简单如下:

I found a strange issue. Open a simple page in Firefox, the code is simple as below:

<html>
  <body>
    <textarea></textarea>
  </body>
</html>

在 Firefox 中,我在 textarea 中输入了一些字符.然后我点击浏览器的刷新按钮.令人惊讶的是,页面刷新后,我输入的内容仍然存在于textarea中.但是,如果我只关注 URL 栏并按 ENTER 键,则刷新后 textarea 是清晰的.

In Firefox, I type some characters in the textarea. Then I click refresh button of the browser. Surprisingly, after the page refreshed, what I typed is still there in textarea. However, if I just focus on URL bar and press ENTER key, the textarea is clear after refreshing.

我在 Linux 的 Firefox 3.6.12 和 MacOS 的 3.6.3 中复制了这个.而且,我只安装了 Firebug 扩展,所以它不应该是由于 Firefox 扩展造成的.

I reproduced this in Firefox 3.6.12 in Linux and 3.6.3 in MacOS. And, I have only Firebug extension installed so it should NOT be due to Firefox extension.

这是一个已知问题吗?点击刷新按钮后如何清除textarea?

Is this a know issue? How to make textarea clear after Refresh button is clicked?

推荐答案

仅用于 textarea:

For textarea only:

<textarea autocomplete="off"></textarea>

对于所有表单域

<form autocomplete="off">

防止 Firefox 记住元标记刷新时的输入值

这篇关于Firefox 缓存 textarea 值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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