問題描述
有一些不同的 jQuery 歷史插件,其中一個比其他任何一個都好......
There are a few different jQuery history plugins out there is one better than any of the others...
我正在嘗試決定選擇哪一個,任何想法或其他嘗試:
I'm trying to decide which one to go with, any thoughts or any others to try:
- http://www.balupton.com/projects/jquery-history
- http://tkyk.github.com/jquery-history-plugin
- http://plugins.jquery.com/project/history
推薦答案
我不確定您要做什么,但我假設您想使用哈希標簽來控制頁面加載,例如 Twitter 和 Facebook.
I'm not exactly sure what you are trying to do, but I'm assuming you want to use hash tags to control page loads like Twitter and Facebook.
如果是這種情況,請查看這篇文章:https://stackoverflow.com/questions/116446/what-is-the-best-back-button-jquery-plugin
If that's the case check out this post: https://stackoverflow.com/questions/116446/what-is-the-best-back-button-jquery-plugin
這是該帖子中的建議:
- Asual:http://www.asual.com/jquery/address/
- jQuery BBQ:http://benalman.com/projects/jquery-bbq-plugin/
- 歷史:http://plugins.jquery.com/project/history李>
- jQuery hashchange:http://benalman.com/projects/jquery-hashchange-plugin/
- ReallySimpleHistory:http://code.google.com/p/reallysimplehistory/
就個人而言,我建議使用 Ben Alman 的 jQuery BBQ,因為它是跨瀏覽器并且非常易于使用.基本上:
Personally, I'd suggest going with Ben Alman's jQuery BBQ as it is cross-browser and very easy to use. Basically:
$(window).bind('hashchange', function(e) {
// Get the hash (fragment) as a string, with any leading # removed. Note that
// in jQuery 1.4, you should use e.fragment instead of $.param.fragment().
var url = $.param.fragment();
});
來源:http://benalman.com/code/項目/jquery-bbq/examples/fragment-basic/
另一個流行的是 Sammy.js (http://code.quirkey.com/sammy/) 這實際上是 Twitter 使用的.
Another popular one is Sammy.js (http://code.quirkey.com/sammy/) this is actually what Twitter uses.
- 基督徒
這篇關于jQuery 歷史插件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!