国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

基于jQuery的history歷史記錄插件

2019-11-21 00:03:00
字體:
來源:轉載
供稿:網友
關于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.你可以存儲到應用程序狀態(tài)的網址散列和恢復它的狀態(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和最現代化的機制。除非是支持一些后備插件工程:

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.
目前哈希將不會被記錄在歷史上,如果你用手或加載更新書簽網址哈希。

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

打包下載
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 祁门县| 凤阳县| 扶风县| 平舆县| 佛坪县| 石门县| 阳山县| 凤山市| 乐平市| 黄平县| 长兴县| 和平县| 香河县| 曲阳县| 林甸县| 疏附县| 理塘县| 鹤岗市| 杭锦后旗| 盈江县| 江陵县| 宜都市| 肇州县| 钟祥市| 新化县| 锦州市| 布拖县| 清水县| 阜新市| 安达市| 年辖:市辖区| 肥西县| 大渡口区| 襄城县| 龙南县| 军事| 休宁县| 上栗县| 华安县| 五莲县| 虞城县|