<!--
在当前页面中,如果做出了一些页面功能操作,想在页面跳转之后,在点后退,可后退到当前页面某个指定功能状态的情况下,
可以在做出相对操作时执行addHistory(module)方法来给地址栏添加参数状态记录当前状态,这样可在后退时退到当前状态下
-->
<%@ page language="java" pageEncoding="UTF-8"%>
<html>
<head>
<title>Ext3浏览器后退功能</title>
<script type="text/javascript">
Ext.onReady(function() {
//初始化history组件
Ext.History.init();
//判断如果当前路蓝旗地址#后有test参数,执行传入的方法
initHistoryUrl("test", function() {
//js函数,内部自定义实现
});
//特殊情况可覆盖浏览器前进后退按钮,当浏览器被添加标记时,点击后退按钮仅执行此方法
/*
Ext.History.on('change', function(token){
if(token){
//相应操作
}
});
Ext.History.back(); ext的后退前进方法
Ext.History.forward();
*/
});
/**
* 页面初始化时,截取地址栏#后的标记来判断是否需要执行相应的方法
*/
function initHistoryUrl(module, fn) {
var url = window.location.href;
var has = url.indexOf('#');
if (has != -1) {
var history = url.substring(has + 1);
if (history == module) fn();
}
}
/**
* 在浏览器地址上添加标记
*/
function addHistory(module) {
Ext.History.add(module);
}
</script>
</head>
<body>
<!-- Ext.History所需的form begin-->
<form id="history-form" class="x-hidden"><input type="hidden" id="x-history-field" /> <iframe id="x-history-frame"> </iframe></form>
<!-- Ext.History所需的form end -->
</body>
</html>
详细解决方案
Ext.History浏览器自定义前行后退功能
热度:79 发布时间:2013-08-09 15:16:24.0
相关解决方案
- Iframe top.history.go(@Num)有关问题
- Response.Write("<script language='javascript' type='text/javascript'>history.back()</script>")
- 返回前一頁面的問題:Button1.Attributes.Add("onclick" "history.go(-1);return false;");無效。该怎么解决
- history.back后退至上一页,遮罩层div无法消除的有关问题
- html,jsp返回下一页 history.go(-1)网页过期
- history.back()丢失会话数据的解决方法
- window.history.go(-一)返回且刷新页面
- google Chrome浏览器上,按后退按钮*history.back() 缓存有关问题
- history.back与history.go()是什么意思,怎么应用
- history.back() 网页已过期的解决方法
- history.back 遇到有关问题
- javascript:history.go(-一)跳回上一页为啥还弹出框
- history.go(-一)后button失效
- javascript:history.go(-1)返回下一页时,网页已过期
- history.back,Firefox 必须发送将会导致重复之前动作的数据(例如搜索或者上订单)
- jsp写入cookie中文出现乱码有关问题,history.go(-1) 或 history.back() 网页已过期 解决方法
- javascript 判断 history.back() 起作用了没有
- jquery.history.js 范例
- javascript:history.go()跟History.back()的区别
- 关于用window.history.go后退次数好像只有6次?解决办法
- history.back 不调用action吗,该怎么解决
- out.write("帐号长度不能大于50个字母或25个汉字!"+"<a href='javascript:window.history.go(-1)'>返回</a>")怎么实现返回后还能刷新
- <a href="javascript:history.back(1)?<%=request.getPatameter()%>这样写为什么不对?解决方法
- []小弟我要求查看change history。
- ZOJ 2158 Truck History
- The History of Computer(计算机发展史)
- 最小生成树--Truck History(poj 1789);
- react 服务器端渲染 ssr 中 localstorage/history/window is not defined 解决方案
- 用日志记录Linux用户执行的每一条命令(history)
- who 、last、history