基于jQuery的history历史记录插件


Posted in Javascript onDecember 11, 2010

关于jQuery的历史
jQuery history plugin helps you to support back/forward buttons and bookmarks in your javascript applications.历史的jQuery插件可以帮助您回到您的JavaScript支持应用程序/前进按钮和书签。 You can store the application state into URL hash and restore the state from it.你可以存储到应用程序状态的网址散列和恢复它的状态。

Download jquery.history.js
下载jquery.history.js

jQuery history plugin is hosted on Github.
历史的jQuery插件托管在Github上。
Please visit the project page for development.
请访问项目页面进行开发。

Supported browsers支持的浏览器
Internet Explorer 6, 7, and 8+的Internet Explorer 6,7和8 +
Safari 4 and 5+的
Safari 4和5 +
Google Chrome 4+
谷歌浏览器4 +
This plugin is built on hashchange event , which is defined in HTML5 and supported in most modern browsers. Unless it is supported the plugin works on some fallback mechanisms:这个插件是在建hashchange事件 ,这是定义在浏览器支持HTML5和最现代化的机制。除非是支持一些后备插件工程:

monitoring location.hash by setInterval (Safari 4)
监测的setInterval location.hash(Safari 4中)
iframe and setInterval (IE 6, 7, and compatibility mode on IE8)
iframe的和setInterval(即6,IE8的第7和兼容模式)
Known issues
已知问题
IE6, 7, and IE8 compatibility mode
在IE6,7和IE8的兼容模式
Back/forward button will not work if you refresh the page and the document is reloaded.
后退/前进按钮将不会工作,如果你刷新页面,该文件重新加载。
IE8 standards mode
IE8的标准模式
The current hash will not be recorded in the history if you update the URL hash by hand or loading bookmarks.
目前哈希将不会被记录在历史上,如果你用手或加载更新书签网址哈希。

Demos
Some demos are available here and included in the repository.
And this site itself is built on the plugin:

(function($){ 
var origContent = ""; 
function loadContent(hash) { 
if(hash != "") { 
if(origContent == "") { 
origContent = $('#content').html(); 
} 
$('#content').load(hash +".html", 
function(){ prettyPrint(); }); 
} else if(origContent != "") { 
$('#content').html(origContent); 
} 
} 
$(document).ready(function() { 
$.history.init(loadContent); 
$('#navigation a').click(function(e) { 
var url = $(this).attr('href'); 
url = url.replace(/^.*#/, ''); 
$.history.load(url); 
return false; 
}); 
}); 
})(jQuery);

打包下载
Javascript 相关文章推荐
在网页里看flash的trace数据的js类
Jan 10 Javascript
基于jQuery的js分页代码
Jun 10 Javascript
js获取html文件的思路及示例
Sep 17 Javascript
jquery内置验证(validate)使用方法示例(表单验证)
Dec 04 Javascript
jquery trigger伪造a标签的click事件取代window.open方法
Jun 23 Javascript
使用AngularJS编写较为优美的JavaScript代码指南
Jun 19 Javascript
深入剖析JavaScript编程中的对象概念
Oct 21 Javascript
详解Angualr 组件间通信
Jan 21 Javascript
jquery submit()不能提交表单的解决方法
Apr 24 jQuery
利用node.js爬取指定排名网站的JS引用库详解
Jul 25 Javascript
vue实现全选和反选功能
Aug 31 Javascript
小程序实现页面顶部选项卡效果
Nov 06 Javascript
基于Jquery 解决Ajax请求的页面 浏览器后退前进功能,页面刷新功能实效问题
Dec 11 #Javascript
DIY jquery plugin - tabs标签切换实现代码
Dec 11 #Javascript
为超链接加上disabled后的故事
Dec 10 #Javascript
input按钮的事件处理大全
Dec 10 #Javascript
JavaScript(JS) 压缩 / 混淆 / 格式化 批处理工具
Dec 10 #Javascript
js下关于onmouseout、事件冒泡的问题经验小结
Dec 09 #Javascript
客户端限制只能上传jpg格式图片的js代码
Dec 09 #Javascript
You might like
在PHP中使用X-SendFile头让文件下载更快
2014/06/01 PHP
CI框架自动加载session出现报错的解决办法
2014/06/17 PHP
Laravel 5框架学习之表单
2015/04/08 PHP
JS代码格式化和语法着色V2
2006/10/14 Javascript
JavaScript获取flash对象与网上的有所不同
2014/04/21 Javascript
js实现文章文字大小字号功能完整实例
2014/11/01 Javascript
javascript制作坦克大战全纪录(1)
2014/11/27 Javascript
javascript中indexOf技术详解
2015/05/07 Javascript
javascript事件委托的方式绑定详解
2015/06/10 Javascript
nodejs利用http模块实现银行卡所属银行查询和骚扰电话验证示例
2016/12/30 NodeJs
vue.js打包之后可能会遇到的坑!
2018/06/03 Javascript
Vue-cli3项目配置Vue.config.js实战记录
2018/07/29 Javascript
浅谈Vue.set实际上是什么
2019/10/17 Javascript
VUE解决 v-html不能触发点击事件的问题
2019/10/28 Javascript
[02:40]DOTA2英雄基础教程 巨牙海民
2013/12/23 DOTA
python连接sql server乱码的解决方法
2013/01/28 Python
python利用matplotlib库绘制饼图的方法示例
2016/12/18 Python
python 捕获 shell/bash 脚本的输出结果实例
2017/01/04 Python
教你用Python写安卓游戏外挂
2018/01/11 Python
Python变量赋值的秘密分享
2018/04/03 Python
Python用csv写入文件_消除空余行的方法
2018/07/06 Python
python实现手机销售管理系统
2019/03/19 Python
在pytorch中为Module和Tensor指定GPU的例子
2019/08/19 Python
Python单链表原理与实现方法详解
2020/02/22 Python
在tensorflow以及keras安装目录查询操作(windows下)
2020/06/19 Python
python一些性能分析的技巧
2020/08/30 Python
用python读取xlsx文件
2020/12/17 Python
CSS3 实现的缩略图悬停效果
2020/12/09 HTML / CSS
法律专业自我鉴定
2013/10/03 职场文书
学院书画协会部门职责
2013/11/28 职场文书
乳制品整治工作方案
2014/05/29 职场文书
校园标语大全
2014/06/19 职场文书
大学生第一学年自我鉴定
2014/09/12 职场文书
酒店财务经理岗位职责
2015/04/08 职场文书
2016春季运动会通讯稿
2015/07/18 职场文书
在前女友婚礼上,用Python破解了现场的WIFI还把名称改成了
2021/05/28 Python