javascript - 使用表单时删除缓存的搜索
问题描述
我正在使用这段代码:
<form action="https://google.com/search" method="get">
<input type="text" name="q" />
允许我从自定义主页使用 google 进行搜索。但是在每次搜索之后,它似乎都在缓存我的搜索词。
当我单击表单返回 HTML 页面时,它会将我以前的搜索作为自动填充下拉框。
我想禁用此功能并停止页面缓存。
谢谢你
解决方案
它应该像在表单元素中添加 autocomplete="off" 一样简单。
<form action="https://google.com/search" method="get" autocomplete="off"></form>
推荐阅读
- node.js - 如何在 Node Js 中写一些带胡子的东西
- python - 将自定义层的权重从 1D 分配到 2D
- reactjs - React.js 地图功能不使用 useState 显示值
- r - R - 由行连接的列字符串的所有成对组合
- java - Springboot:在同一项目中同时导入 spring-data-jdbc 和 spring-data-cassandra 时出现问题
- sql - Oracle SQL 多个别名为一个
- android - 跨度内的Android HTML跨度不层叠样式
- ios - 自定义键盘附件视图输入
- reactjs - Prismjs 没有突出显示 React 组件
- c# - 无法使用 LINQ 找到嵌套属性