jQuery 历史插件

jQuery History Plugin(jQuery 历史插件)
本文介绍了jQuery 历史插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

有一些不同的 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 历史插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
append() 方法在被选元素的结尾(仍然在内部)插入指定内容。 语法: $(selector).append( content ) var creatPrintList = function(data){ var innerHtml = ""; for(var i =0;i data.length;i++){ innerHtml +="li class='contentLi'"; innerHtml +="a href
问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
Ordinals in words javascript(javascript中的序数)