问题
I spent a long time looking into this about a year ago, I tried:
- Jquery BBQ plugin
- Jquery History plugin
- jquery .address plugin
I found the jquery.address plugin to be the best, but these things change quickly.
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)
回答1:
Hey Guys, I'm 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!
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
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.
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.
回答2:
I've looked trough this and have researched them and indeed those 3 are the best. I like history.js because it supports html5 history management that changes the URL instead of adding hashes :). At least that's what the author told me.
来源:https://stackoverflow.com/questions/5513106/current-state-of-jquery-history-back-button-plugins