原创

input禁用缓存

温馨提示:
本文最后更新于 2022年09月19日,已超过 557 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我

input 的属性autocomplete 默认为on 其含义代表是否让浏览器自动记录之前输入的值,如果不想记录可以在input中加入autocomplete="off" 来关闭记录。

1. 在不想使用缓存的input中添加 autocomplete="off" 

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

2.在 input 所在的form标签中添加 autocomplete="off"

<form action="#" autocomplete="off">
    <input type="text" autocomplete="off" name="input" />
</form>

3.禁止页面读取缓存数据

<meta   http-equiv= "Pragma"   content= "no-cache" /> 
<meta   http-equiv= "Cache-Control"   content= "no-cache" /> 
<meta   http-equiv= "Expires"   content= "0" /> 
正文到此结束
该篇文章的评论功能已被站长关闭
本文目录