开发者

jQuery History Plugin

开发者 https://www.devze.com 2023-01-29 05:08 出处:网络
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 t开发者_高级运维o go with, any thoughts or any others to try:

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 t开发者_高级运维o 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


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.

If that's the case check out this post: https://stackoverflow.com/questions/116446/what-is-the-best-back-button-jquery-plugin

Edit:

Here's what was suggested on that post:

  • Asual: http://www.asual.com/jquery/address/
  • jQuery BBQ: http://benalman.com/projects/jquery-bbq-plugin/
  • History: http://plugins.jquery.com/project/history
  • jQuery hashchange: http://benalman.com/projects/jquery-hashchange-plugin/
  • ReallySimpleHistory: http://code.google.com/p/reallysimplehistory/

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

Source: http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/

Another popular one is Sammy.js (http://code.quirkey.com/sammy/) this is actually what Twitter uses.

  • Christian


I try to use following libs

  • jQuery BBQ: http://benalman.com/projects/jquery-bbq-plugin/
  • History: http://plugins.jquery.com/project/history
  • ReallySimpleHistory: http://code.google.com/p/reallysimplehistory/

and was not satisfied. Finaly I found fresh (working with jquery 1.9.1) and simple one:

jQuery.history https://github.com/yeikos/jquery.history


Not sure if this helps anyone but here's a plugin that can help in managing multiple hash "items". https://github.com/Cipa/HashStack

You can save a list of items in the hash like the values of some select elements that when changed reload some part of the page using ajax.

0

精彩评论

暂无评论...
验证码 换一张
取 消