找回密码
 立即注册
即日起,论坛关闭新用户注册和登录,论坛相关的贴子保留查阅和下载。获得授权后,有技术问题可联系微信 13199509559 一对一解决。 2024-3-12
查看: 3668|回复: 0

不让浏览器缓存input的值

206

主题

206

主题

206

主题

管理员

Rank: 9Rank: 9Rank: 9

积分
0
admin 发表于 2019-12-3 13:36:29 | 显示全部楼层 |阅读模式
方法一:
在不想使用缓存的input中添加 autocomplete="off"
<input type="text" autocomplete="off" name="test" />

方法二:
在 input 所在的form标签中添加 autocomplete="off";

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

方法三  不让页面读取缓存数据

<meta   http-equiv= "Pragma"   content= "no-cache" />
<meta   http-equiv= "Cache-Control"   content= "no-cache" />
<meta   http-equiv= "Expires"   content= "0" />
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表