基于jQuery的history历史记录插件

关于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 _disibledevent=>复制代码 代码如下:

(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);


打包下载
Tags: 

延伸阅读

最新评论

发表评论