基于jQuery的history歷史記錄插件
更新時間:2010年12月11日 14:12:07 作者:
history歷史記錄插件可以幫助您回到您的JavaScript支持應(yīng)用程序/前進按鈕和書簽。你可以存儲到應(yīng)用程序狀態(tài)的網(wǎng)址散列和恢復(fù)它的狀態(tài)。
關(guān)于jQuery的歷史
jQuery history plugin helps you to support back/forward buttons and bookmarks in your javascript applications.歷史的jQuery插件可以幫助您回到您的JavaScript支持應(yīng)用程序/前進按鈕和書簽。 You can store the application state into URL hash and restore the state from it.你可以存儲到應(yīng)用程序狀態(tài)的網(wǎng)址散列和恢復(fù)它的狀態(tài)。
Download jquery.history.js
下載jquery.history.js
jQuery history plugin is hosted on Github.
歷史的jQuery插件托管在Github上。
Please visit the project page for development.
請訪問項目頁面進行開發(fā)。
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和最現(xiàn)代化的機制。除非是支持一些后備插件工程:
monitoring location.hash by setInterval (Safari 4)
監(jiān)測的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.
目前哈希將不會被記錄在歷史上,如果你用手或加載更新書簽網(wǎng)址哈希。
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);
打包下載
jQuery history plugin helps you to support back/forward buttons and bookmarks in your javascript applications.歷史的jQuery插件可以幫助您回到您的JavaScript支持應(yīng)用程序/前進按鈕和書簽。 You can store the application state into URL hash and restore the state from it.你可以存儲到應(yīng)用程序狀態(tài)的網(wǎng)址散列和恢復(fù)它的狀態(tài)。
Download jquery.history.js
下載jquery.history.js
jQuery history plugin is hosted on Github.
歷史的jQuery插件托管在Github上。
Please visit the project page for development.
請訪問項目頁面進行開發(fā)。
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和最現(xiàn)代化的機制。除非是支持一些后備插件工程:
monitoring location.hash by setInterval (Safari 4)
監(jiān)測的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.
目前哈希將不會被記錄在歷史上,如果你用手或加載更新書簽網(wǎng)址哈希。
Demos
Some demos are available here and included in the repository.
And this site itself is built on the plugin:
復(fù)制代碼 代碼如下:
(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);
打包下載
相關(guān)文章
jQuery中彈出iframe內(nèi)嵌頁面元素到父頁面并全屏化的實例代碼
這篇文章主要介紹了jQuery中彈出iframe內(nèi)嵌頁面元素到父頁面并全屏化的實例代碼,需要的朋友可以參考下2016-12-12jquery實現(xiàn)的動態(tài)回到頂部特效代碼
這篇文章主要介紹了jquery實現(xiàn)的動態(tài)回到頂部特效代碼,涉及jQuery基于時間函數(shù)的定時遞歸調(diào)用實現(xiàn)帶緩沖效果的移動功能,具有一定參考借鑒價值,需要的朋友可以參考下2015-10-10Jquery EasyUI Datagrid右鍵菜單實現(xiàn)方法
這篇文章主要為大家詳細介紹了Jquery EasyUI Datagrid右鍵菜單的實現(xiàn)方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-12-12把html頁面的部分內(nèi)容保存成新的html文件的jquery代碼
把html頁面的部分內(nèi)容保存成新的html文件,用到了jquery的獲取指定id的內(nèi)容。然后保存代碼。2009-11-11從零開始學(xué)習(xí)jQuery (四) jQuery中操作元素的屬性與樣式
本篇文章講解如何使用jQuery獲取和操作元素的屬性和CSS樣式. 其中DOM屬性和元素屬性的區(qū)分值得大家學(xué)習(xí).2011-02-02jQuery實現(xiàn)點擊按鈕文字變成input框點擊保存變成文字
這篇文章主要介紹了jQuery實現(xiàn)點擊按鈕文字變成input框點擊保存變成文字的相關(guān)資料,非常具有參考借鑒價值,需要的朋友可以參考下2016-05-05