問題描述
大約一年前,我花了很長時間研究這個問題,我試過了:
I spent a long time looking into this about a year ago, I tried:
- Jquery BBQ 插件
- Jquery 歷史插件
- jquery .address 插件
我發現 jquery.address 插件是最好的,但這些東西變化很快.
I found the jquery.address plugin to be the best, but these things change quickly.
最近有沒有人徹底研究過這個選項?在我再次集成 jquery.address 之前渴望聽到一些想法(我之前沒有任何問題)
Has anyone thoroughly researched the options for this RECENTLY? Keen to hear some thoughts before I integrate jquery.address again (I didn't have any issues with it before)
推薦答案
我是History的作者.正如 SnippetSpace 在他的回答中所說,js 與 HTML5 History API 為舊版瀏覽器提供可選的哈希回退.HTML5 History API 允許您直接修改 url,因此不再需要哈希!耶!
I am the author of History.js which as SnippetSpace has said in his answer works with the HTML5 History API with an optional hash-fallback for older browsers. The HTML5 History API allows you to modify the url directly, so no need for hashes anymore! Yay!
有關后退/前進插件當前情況的列表,您可以在此處查看:https://github.com/Modernizr/Modernizr/wiki/HTML5-跨瀏覽器-Polyfills
For a listing of the current situation of back/forward plugins you can check here: https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills
由于 HTML5 History API 是一個正確的解決方案對于 back/forward/hash/hashbang 問題,與舊的 hashchange 解決方案相比,這確實是要走的路.哈希的問題包括:訪問哈希 url 時雙重加載、不同的 url、與禁用 js 的用戶共享哈希鏈接不起作用.
As the HTML5 History API is a proper solution to the back/forward/hash/hashbang problem, it's really the way to go compared to the old hashchange solutions. Problems with hashes include: double load when accessing a hashed url, different urls, sharing hashed links with js-disabled users don't work.
還有一個支持 HTML5 History API 的插件是 jQuery Address,但是它不支持諸如 replaceState 之類的東西,而且我不確定它對 HTML5 History API 的實際跨瀏覽器支持.但是看看它的 問題列表 我是說它的支持不是好吧.
There is one other plugin which supports the HTML5 History API which is jQuery Address, however it does not support things like replaceState and I'm unsure of it's actual cross-browser support for the HTML5 History API. But looking at it's list of issues I'm saying that it's support isn't that well.
這篇關于Jquery 歷史/后退按鈕插件的當前狀態?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!