我怎样才能阻止Firefox缓存本地主机上的textarea的内容? [英] How can I stop Firefox from caching the contents of a textarea on localhost?

查看:130
本文介绍了我怎样才能阻止Firefox缓存本地主机上的textarea的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地工作,有很多< textarea> 元素。然而,每当我重新加载网站时,< textarea> 中的内容仍然存在。



我能做些什么来阻止网站被缓存,不使用任何浏览器内功能



我正在寻找网站内的解决方案,所以当我办公室的其他用户打开它时,他们不会有同样的问题。

解决方案

您可以通过将autocomplete属性设置为off来禁用它:

 < input name =whatevertype =textautocomplete =off> 

您也可以在整个表单中禁用它:

 < form name =form1id =form1method =postautocomplete =off> 

https://developer.mozilla.org/en/How_to_Turn_Off_Form_Autocompletion


I am working on a site locally, which has a lot of <textarea> elements.

However, everytime I reload the site the content in the <textarea> is still there. This only happens when I hit reload / F5.

What can I do to stop the site from being cached, without using any in-browser functions.

I am looking for a solution within the site, so when other users in my office opens it, they won't have the same problem.

解决方案

You can disable it in your html by setting the autocomplete attribute to off:

<input name="whatever" type="text" autocomplete="off">

You could also disable it for the entire form:

<form name="form1" id="form1" method="post" autocomplete="off">

https://developer.mozilla.org/en/How_to_Turn_Off_Form_Autocompletion

这篇关于我怎样才能阻止Firefox缓存本地主机上的textarea的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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