jQuery.expr [':']如何工作以及jQuery1.8.x及更高版本的文档在哪里? [英] How does jQuery.expr[':'] work and where is it documented for jQuery1.8.x and later?

查看:102
本文介绍了jQuery.expr [':']如何工作以及jQuery1.8.x及更高版本的文档在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经全神贯注地查看了有关此语法的一些明确文档。它用于创建自定义过滤器以选择DOM中的特定元素。 Benjamin Arthur Lupton在 ajaxify-html5.js 的主题示例中有一个很好的例子(见第45行,其中函数是定义和使用它的第78行),他提供了如何使用他的历史插件。

I've looked all over for some clear documentation on this syntax. It is used to create custom filters to select very specific elements in the DOM. There is a good example by Benjamin Arthur Lupton in the ajaxify-html5.js gist example (see line 45 where the function is defined and line 78 where it is used), which he provides to show how to ajaxify a web site using his history plug-in.

Shane Riley还有一个相当广泛的博客叫做添加过滤器表达式,但我已经浏览了jQuery文档,我找不到任何文档。

There is also a fairly extensive blog by Shane Riley called Adding Filter Expressions, but I've scoured through the jQuery documentation and I can't find any documentation.

如果你可以,我将不胜感激

I would be grateful if you could either


  • 指向官方 expr 函数的文档

  • 告诉我在源文件中找到它的位置(我看过 - 找不到它)

  • 或建议基于正确记录的技术的替代语法

  • point me to the official documentation for the expr function
  • show me where to find it in the source files (I've looked - can't find it)
  • or suggest alternative syntax based on a technique that is properly documented

我是看了 jQuery.filter 但是在他的ajaxify脚本中找不到Lupton技术的替代品。

I've looked at jQuery.filter but can't figure out an alternative to Lupton's technique in his ajaxify script.

我很想使用最近的jQuery。我正在使用v 1.8.2,并且很快将升级到1.9.x.

I'm keen to work with a recent jQuery. I'm working with v 1.8.2 and will be aiming to upgrade to 1.9.x soon.

推荐答案

它是<的一部分a href =https://github.com/jquery/sizzle =noreferrer> Sizzle ,这是jQuery使用的选择器引擎。

It's part of Sizzle which is the selector engine that jQuery uses.

他们现在有文档解释其用法,以及1.8.x之前和之后的示例:
https://github.com/jquery/sizzle/wiki/Sizzle-Documentation#-pseudo-selectors

They now have documentation explaining its usage with examples for pre and post 1.8.x: https://github.com/jquery/sizzle/wiki/Sizzle-Documentation#-pseudo-selectors

这篇关于jQuery.expr [':']如何工作以及jQuery1.8.x及更高版本的文档在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆