手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆

推荐插件:jquery-bbq

首页 > Javascript >

什么 是jquery BBQ?
这是一个jquery插件,BBQ的意思是back button & query。你知道的,以前的jqueryTAB在点击后都无法通过后退和前进恢复原来的点击事件等。而BBQ在每次点击的时候都相当于在历史里加入了一个记录。也就因此可以使得我们能够通过浏览器的前进、后退来重现刚才的点击。

官网在这里:https://github.com/cowboy/jquery-bbq

jQuery BBQ leverages the HTML5 hashchange event to allow simple, yet powerful bookmarkable #hash history. In addition, jQuery BBQ provides a full .deparam() method, along with both hash state management, and fragment / query string parse and merge utility methods.

This plugin and the jQuery urlInternal plugin supersede the URL Utils plugin.

Note: If you’re using jQuery 1.3.2 or earlier and need BBQ to merge query string or fragment params containing [], you’ll want to include the jQuery 1.4 .param method in your code.

Also, my article Cooking BBQ: the original recipe gives a history of jQuery BBQ along with some plugin authoring guidelines, if you’re interested.

What jQuery BBQ allows you to do:

While this brief overview will give you the broad strokes, for specifics you should look at the the basic examples below, read the documentation, and check out the full examples listed above.

  • Deserialize any params string, the document query string or fragment into an object, including the new jQuery.param format (new in jQuery 1.4, read more here). (example)
  • Merge any URL plus query string or fragment params—in an object, params string or second URL (including the current document location)—into a new URL.
  • Update the “URL attribute” (ie. a[href], img[src], form[action], etc) in multiple elements, merging any URL plus query string or fragment params—in an object, params string or second URL (including the current document location)—into a new URL, which is then set into that attribute.
  • Push (and retrieve) bookmarkable, history-enabling “state” objects or strings onto the document fragment, allowing cross-browser back- and next-button functionality for dynamic web applications (example 1, example 2, example 3)
  • Bind event handlers to a normalized, cross-browser hashchange event (example 1, example 2, example 3)

 

These working examples, complete with fully commented code, illustrate a few ways in which this plugin can be used.

http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/
http://benalman.com/code/projects/jquery-bbq/examples/fragment-advanced/
http://benalman.com/code/projects/jquery-bbq/examples/fragment-jquery-ui-tabs/
http://benalman.com/code/projects/jquery-bbq/examples/deparam/




本站采用创作共享版权协议, 要求署名、非商业和保持一致. 本站欢迎任何非商业应用的转载, 但须注明出自"易栈网-膘叔", 保留原始链接, 此外还必须标注原文标题和链接.

Tags: jquery, jquery-bbq

« 上一篇 | 下一篇 »

只显示10条记录相关文章

JQuery -- this 和 $(this) 的区别 (浏览: 86418, 评论: 3)
[转载]超强大的jquery formValidator (浏览: 51813, 评论: 3)
jQuery插件---获取URL参数 (浏览: 47113, 评论: 1)
jQuery的html()等方法介绍 (浏览: 46523, 评论: 1)
取得html中的comment的内容 (浏览: 43344, 评论: 2)
jQuery的bind函数 (浏览: 41641, 评论: 1)
将Yiiframework与JQuery easyUI整合使用 (浏览: 39076, 评论: 2)
jQuery一些插件的链接[转] (浏览: 38647, 评论: 2)
取消radio的选中状态 (浏览: 37802, 评论: 1)
JQuery学习第一天 (浏览: 36345, 评论: 3)

1条记录访客评论

不错支持下,再分享35本编程入门教程(ITPUX技术网的编程书籍下载地址:http://www.itpux.com/article-17-1.html ),推荐的包括HTML/CSS/JavaScript/HTML5/jQuery/PHP/ASP/Python/Android/iOS/C/LINUX等编程自学入门书籍。

Post by it技术网站 on 2015, March 8, 11:07 AM 引用此文发表评论 #1


发表评论

评论内容 (必填):