Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
156 views
in Technique[技术] by (71.8m points)

javascript - jQuery History Plugin

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:

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...