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

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

问题描述

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

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

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

我在Linux 3.6.12和3.6.3在MacOS。而且,我只安装了Firebug扩展,所以它不应该是由于Firefox扩展。



这是一个知道的问题吗?
如何在单击刷新按钮后清除textarea?

解决方案

仅适用于textarea:

 < textarea autocomplete =off>< / textarea> 

所有表单字段

 < form autocomplete =off> 


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

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

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.

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.

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

解决方案

For textarea only:

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

For all form fields

<form autocomplete="off">

Preventing Firefox from remembering the input value on refresh with Meta tag

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

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