html和JavaScript,用户点击浏览器后退按钮,或者返回上一步自动刷新方式
2024-10-19 08:43:47
浏览器用户返回上一步,自动刷新
方式一、
<input type="hidden" id="refreshed" value="no">
<script type="text/javascript">
onload=function(){
var e=document.getElementById("refreshed");
if(e.value=="no")e.value="yes";
else{e.value="no";location.reload();}
}
</script >
方式二、
header("Cache-Control: no-store, must-revalidate, max-age=0");
header("Pragma: no-cache");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
方式三、
window.onpageshow = function(event) {
if (event.0) {
window.location.reload()
}
};
转载注明出处:https://www.cnblogs.com/cblogs/p/6126387.html
最新文章
- bzoj4691: Let There Be Light
- hdu 1429
- MySQL架构优化实战系列1:数据类型与索引调优全解析
- HDU 1556 Color the ball(线段树区间更新)
- SVN报Previous operation has not finished; run &#39;cleanup&#39; if it was interrupted错误的解决方法
- jquery tree events didn&#39;t work
- 利用 Gitbook 生成文档中心站点
- 《无懈可击的Web设计》_灵活的文字
- 【pyhton】import math与import cmath
- systemtap [主设备号,次设备好,inode]监控文件
- 在SQL中修改数据库名称
- 三步快速解决dll冲突问题
- LeetCode 40. Combination Sum II (组合的和之二)
- js原生的轮播,原理以及实践
- codeforce 337D Book of Evil ----树形DP&;bfs&;树的直径
- 深入理解 RPC
- ZJOI2008 生日聚会Party
- 淺談 Entity 的概念
- C# HttpWebRequest 笔记
- Linux学习笔记(第九章)
热门文章
- VirtualBox network / study environment setup for RHEL
- img 标签注意 默认img标签,有一个1px的边框 img{ border: 0; }
- HTTP中的header头解析说明
- UVA10905: Children&#39;s Game(排序)
- 使用Spring注解获取配置文件信息
- 创建发布Webservice以及wsimport工具
- EventFiringWebDriver网页事件监听(一)
- jQuery—$让渡
- 从两道题看go channel的用法
- 基于HTML5 FileSystem API的使用介绍(转)