﻿<?xml version='1.0' encoding='utf-8'?>
<?xml-stylesheet type='text/xsl' href='styles/cat_cn.xsl'?>
<docs version='1.1'>
<cat value='Core'>
<method cat='Core' type='jQuery' short='这个函数接收一个包含CSS或基本的XPath选择符的字符串，然后用这个字符串去匹配一组元素。' name='$'>
<cndesc>
这个函数接收一个包含CSS或基本的XPath选择符的字符串，然后用这个字符串去匹配一组元素。

jQuery的核心功能都是通过这个函数实现的。
jQuery中的一切都构建于这个函数之上，或者说都是在以某种方式使用这个函数。
这个函数最基本的用法就是向它传递一个表达式（通常由CSS或XPath选择符组成），然后根据这个表达式来查询所有匹配的元素。

在默认情况下，$()查询的是当前HTML文档中的DOM元素。 
</cndesc>
<desc>This function accepts a string containing a CSS or
basic XPath selector which is then used to match a set of elements.

The core functionality of jQuery centers around this function.
Everything in jQuery is based upon this, or uses this in some way.
The most basic use of this function is to pass in an expression
(usually consisting of CSS or XPath), which then finds all matching
elements.

By default, $() looks for DOM elements within the context of the
current HTML document.</desc>
<see>$(Element)</see>
<see>$(Element&lt;Array&gt;)</see>
<params type='String' name='expr'>
<desc>用来查询用的字符串</desc>
</params>
<params type='Element|jQuery' name='context'>
<desc>（可选）作为上下文的DOM元素、文档或jQuery对象。</desc>
</params>
<examples>
<desc>找到所有是div元素子元素的p元素。</desc>
<before>&lt;p&gt;one&lt;/p&gt; &lt;div&gt;&lt;p&gt;two&lt;/p&gt;&lt;/div&gt; &lt;p&gt;three&lt;/p&gt;</before>
<code>$("div &gt; p")</code>
<result>[ &lt;p&gt;two&lt;/p&gt; ]</result>
</examples>
<examples>
<desc>在文档的第一个表单中，搜索所有单选按钮（或：type值为radio的input元素）。</desc>
<code>$("input:radio", document.forms[0])</code>
</examples>
<examples>
<desc>查询指定XML文档中的所有div元素。</desc>
<code>$("div", xml.responseXML)</code>
</examples>
</method>
<method cat='Core' type='jQuery' see='appendTo(String)' short='由HTML标记代码动态创建DOM元素。' name='$'>
<cndesc>
这个函数接收一个由HTML标记代码组成的字符串。

这个HTML字符串不同于用来表示那些HTML字符串、并据以查询相应DOM元素的选择符，一般而言，随后都会把这个HTML代码串插入到文档中去。
</cndesc>
<desc>This function accepts a string of raw HTML.

The HTML string is different from the traditional selectors in that
it creates the DOM elements representing that HTML string, on the fly,
to be (assumedly) inserted into the document later.</desc>
<params type='String' name='html'>
<desc>要动态创建的HTML标记代码字符串</desc>
</params>
<examples>
<desc>
动态创建一个div元素（以及其中的所有内容），
并将它追加到ID值为body的元素中。
在这个函数的内部，是通过临时创建一个元素，并将这个元素的innerHTML属性设置为给定的标记字符串，来实现标记到DOM元素转换的。
所以，这个函数既有灵活性，也有局限性。
</desc>
<code>$("&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt;").appendTo("#body")</code>
</examples>
</method>
<method cat='Core' type='jQuery' short='Wrap jQuery functionality around a single or multiple DOM Element(s).' name='$'>
<cndesc>
为一个或多个DOM元素捆绑jQuery功能。

这个函数也可以接收XML文档和Window对象（虽然它们不是DOM元素）作为有效的参数。
</cndesc>
<desc>Wrap jQuery functionality around a single or multiple DOM Element(s).

This function also accepts XML Documents and Window objects
as valid arguments (even though they are not DOM Elements).</desc>
<params type='Element|Array&lt;Element&gt;' name='elems'>
<desc>由jQuery对象封装的DOM元素</desc>
</params>
<examples>
<desc>与 $("div &gt; p") 相同。</desc>
<before>&lt;p&gt;one&lt;/p&gt; &lt;div&gt;&lt;p&gt;two&lt;/p&gt;&lt;/div&gt; &lt;p&gt;three&lt;/p&gt;</before>
<code>$(document).find("div &gt; p")</code>
<result>[ &lt;p&gt;two&lt;/p&gt; ]</result>
</examples>
<examples>
<desc>把页面的背景颜色设置为黑色。</desc>
<code>$(document.body).css("background","red");</code>
</examples>
<examples>
<desc>隐藏表单中的所有input元素。</desc>
<code>$( myForm.elements ).hide()</code>
</examples>
</method>
<method cat='Core' type='jQuery' short='$(document)的简写方式。' name='$'>
<cndesc>
$(document).ready()的简写方式，允许你绑定一个在DOM文档载入完成后执行的函数。
这个函数的作用如同$(document).ready()一样，只不过用这个函数时，需要把页面中所有其他的$()操作符都包装到其中来。
从技术上来说，这个函数是可链接的－－但真正以这种方式链接的情况并不多。
你可以在一个页面中使用任意多个$(document).ready事件。

要详细了解ready事件，见ready(Function)。
</cndesc>
<desc>A shorthand for $(document).ready(), allowing you to bind a function
to be executed when the DOM document has finished loading. This function
behaves just like $(document).ready(), in that it should be used to wrap
all of the other $() operations on your page. While this function is,
technically, chainable - there really isn't much use for chaining against it.
You can have as many $(document).ready events on your page as you like.

See ready(Function) for details about the ready event.</desc>
<params type='Function' name='fn'>
<desc>当DOM载入完成后要执行的函数</desc>
</params>
<examples>
<desc>当DOM就绪可用时，执行其中的函数。</desc>
<code>$(function(){
  // DOM文档已经载入就绪
});</code>
</examples>
</method>
<method cat='Core' type='jQuery' short='创建一个jQuery对象克隆的副本的方法。' name='$'>
<cndesc>
创建一个jQuery对象克隆的副本的方法。
这个函数会从一个jQuery对象中拷贝出一组匹配的元素，继而创建另外一个新的、包含相同元素的jQuery对象。
</cndesc>
<desc>A means of creating a cloned copy of a jQuery object. This function
copies the set of matched elements from one jQuery object and creates
another, new, jQuery object containing the same elements.</desc>
<params type='jQuery' name='obj'>
<desc>要克隆的 jQuery 对象</desc>
</params>
<examples>
<desc>用所有div元素来查找所有p元素，但不会破坏包含在“div”中原始的jQuery对象（就像简单地使用div.find("p")通常都会产生的结果一样）。</desc>
<code>
var div = $("div");
$( div ).find("p");</code>
</examples>
</method>
<method property='1' cat='Core' type='String' short='jQuery库的当前版本号。' name='jquery' private='1'>
<cndesc>
jQuery库的当前版本号。
</cndesc>
<desc>The current version of jQuery.</desc>
</method>
<method property='1' cat='Core' type='Number' short='当前匹配的元素数量。' name='length'>
<cndesc>
当前匹配的元素数量。
</cndesc>
<desc>The number of elements currently matched.</desc>
<examples>
<code>$("img").length;</code>
<result>2</result>
<before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before>
</examples>
</method>
<method cat='Core' type='Number' short='当前匹配的元素数量。' name='size'>
<cndesc>
当前匹配的元素数量。
</cndesc>
<desc>The number of elements currently matched.</desc>
<examples>
<code>$("img").size();</code>
<result>2</result>
<before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before>
</examples>
</method>
<method cat='Core' type='Array&lt;Element&gt;' short='取得所有匹配的元素。' name='get'>
<cndesc>
取得所有匹配的元素。
这是取得所有匹配元素的一种以向后兼容的方式（不同于jQuery对象，而实际上哪一个都是元素数组）。
</cndesc>
<desc>Access all matched elements. This serves as a backwards-compatible
way of accessing all matched elements (other than the jQuery object
itself, which is, in fact, an array of elements).</desc>
<examples>
<desc>选择文档中的所有图像，并返回相应的DOM元素数组。</desc>
<before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before>
<code>$("img").get();</code>
<result>[ &lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt; ]</result>
</examples>
</method>
<method cat='Core' type='Element' short='取得其中一个匹配的元素。' name='get'>
<cndesc>
取得其中一个匹配的元素。
num表示取得第几个匹配的元素。
</cndesc>
<desc>Access a single matched element. num is used to access the
Nth element matched.</desc>
<params type='Number' name='num'>
<desc>取得第num个位置上的元素</desc>
</params>
<examples>
<desc>选择文档中所有的图像，并返回第一个。</desc>
<before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before>
<code>$("img").get(0);</code>
<result>[ &lt;img src="test1.jpg"/&gt; ]</result>
</examples>
</method>
<method cat='Core' type='jQuery' short='把jQuery对象设置为一个元素数组，并维持堆栈的状态。' name='set' private='1'>
<cndesc>
把jQuery对象设置为一个元素数组，并维持堆栈的状态。
</cndesc>
<desc>Set the jQuery object to an array of elements, while maintaining
the stack.</desc>
<params type='Elements' name='elems'>
<desc>元素数组</desc>
</params>
<examples>
<code>$("img").set([ document.body ]);</code>
<result>$("img").set() == [ document.body ]</result>
</examples>
</method>
<method cat='Core' type='jQuery' short='Set the jQuery object to an array of elements.' name='setArray' private='1'>
<cndesc>
把jQuery对象设置为一个元素数组。
这个操作完全是破坏性的－－如果你希望维持jQuery对象的堆栈状态，一定要使用.set()函数。
</cndesc>
<desc>Set the jQuery object to an array of elements. This operation is
completely destructive - be sure to use .set() if you wish to maintain
the jQuery stack.</desc>
<params type='Elements' name='elems'>
<desc>数组元素</desc>
</params>
<examples>
<code>$("img").setArray([ document.body ]);</code>
<result>$("img").setArray() == [ document.body ]</result>
</examples>
</method>
<method cat='Core' type='jQuery' short='以每一个匹配的元素作为上下文来执行一个函数。' name='each'>
<cndesc>
以每一个匹配的元素作为上下文来执行一个函数。
这意味着，每次执行传递进来的函数时，函数中的this关键字都指向一个不同的元素（每次都是一个不同的匹配元素）。

而且，在每次执行函数时，都会给函数传递一个表示作为执行环境的元素在匹配的元素集合中所处位置的数字值作为参数。
</cndesc>
<desc>Execute a function within the context of every matched element.
This means that every time the passed-in function is executed
(which is once for every element matched) the 'this' keyword
points to the specific element.

Additionally, the function, when executed, is passed a single
argument representing the position of the element in the matched
set.</desc>
<params type='Function' name='fn'>
<desc>要执行的函数</desc>
</params>
<examples>
<desc>迭代两个图像，并设置它们的src属性。</desc>
<before>&lt;img/&gt;&lt;img/&gt;</before>
<code>$("img").each(function(i){
  this.src = "test" + i + ".jpg";
});</code>
<result>&lt;img src="test0.jpg"/&gt;&lt;img src="test1.jpg"/&gt;</result>
</examples>
</method>
<method cat='Core' type='Number' short='搜索与参数表示的对象匹配的元素，并返回相应元素的索引值。' name='index'>
<cndesc>
搜索与参数表示的对象匹配的元素，并返回相应元素的索引值。
如果找到了匹配的元素，从0开始返回；如果没有找到匹配的元素，返回-1。
</cndesc>
<desc>Searches every matched element for the object and returns
the index of the element, if found, starting with zero.
Returns -1 if the object wasn't found.</desc>
<params type='Element' name='subject'>
<desc>要搜索的对象</desc>
</params>
<examples>
<desc>返回ID值为foobar的元素的索引值。</desc>
<before>&lt;div id="foobar"&gt;&lt;/div&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;</before>
<code>$("*").index( $('#foobar')[0] )</code>
<result>0</result>
</examples>
<examples>
<desc>返回ID值为fo的元素的索引值。</desc>
<before>&lt;div id="foobar"&gt;&lt;/div&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;</before>
<code>$("*").index( $('#foo'))</code>
<result>2</result>
</examples>
<examples>
<desc>因为没有ID值为bar的元素，所以返回 -1。</desc>
<before>&lt;div id="foobar"&gt;&lt;/div&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;</before>
<code>$("*").index( $('#bar'))</code>
<result>-1</result>
</examples>
</method>
<method cat='Core' type='jQuery' short='' name='domManip' private='1'>
<desc></desc>
<params type='Array' name='args'>
<desc></desc>
</params>
<params type='Boolean' name='table'>
<desc>如果没有就在table元素中插入tbody</desc>
</params>
<params type='Number' name='dir'>
<desc>如果dir小于0，则以相反的程序处理参数</desc>
</params>
<params type='Function' name='fn'>
<desc>执行DOM处理的函数</desc>
</params>
</method>
<method cat='Core' type='Object' short='扩展jQuery对象。' name='$.extend'>
<cndesc>
扩展jQuery对象。
可以用于把函数添加到jQuery名称空间中，以及添加插件方法（插件）。
</cndesc>
<desc>Extends the jQuery object itself. Can be used to add functions into
the jQuery namespace and to add plugin methods (plugins).</desc>
<params type='Object' name='prop'>
<desc>要合并到jQuery对象中的对象</desc>
</params>
<examples>
<desc>添加两个插件方法。</desc>
<code>jQuery.fn.extend({
  check: function() {
    return this.each(function() { this.checked = true; });
  },
  uncheck: function() {
    return this.each(function() { this.checked = false; });
  }
});
$("input[@type=checkbox]").check();
$("input[@type=radio]").uncheck();</code>
</examples>
<examples>
<desc>向jQuery名称空间中添加两个函数。</desc>
<code>jQuery.extend({
  min: function(a, b) { return a &lt; b ? a : b; },
  max: function(a, b) { return a &gt; b ? a : b; }
});</code>
</examples>
</method>
<method cat='Core' type='undefined' short='运行这个函数将变量$的控制权让渡给第一个实现它的那个库。' name='$.noConflict'>
<cndesc>
运行这个函数将变量$的控制权让渡给第一个实现它的那个库。
这样可以确保jQuery不会与其他库的$对象发生冲突。

在运行这个函数后，就只能使用iQuery变量访问iQuery对象。
例如，在要用到$("div p")的地方，就必须换成iQuery("div p")。
</cndesc>
<desc>Run this function to give control of the $ variable back
to whichever library first implemented it. This helps to make
sure that jQuery doesn't conflict with the $ object
of other libraries.

By using this function, you will only be able to access jQuery
using the 'jQuery' variable. For example, where you used to do
$("div p"), you now must do jQuery("div p").</desc>
<examples>
<desc>将$引用的对象映射回原始的对象，让渡变量$</desc>
<code>
jQuery.noConflict();
// 开始使用jQuery
jQuery("div p").hide();
// 使用其他库的 $()
$("content").style.display = 'none';</code>
</examples>
<examples>
<desc>恢复使用别名$，然后创建并执行一个函数，在这个函数的作用域中仍然将$作为jQuery的别名来使用。
在这个函数中，原来的$对象是无效的。这个函数对于大多数不依赖于其他库的插件都十分有效。
</desc>
<code>jQuery.noConflict();
(function($) {
  $(function() {
    // 使用 $ 作为 jQuery 别名的代码
  });
})(jQuery);
// 使用 $ 作为别名的其他库的代码</code>
</examples>
</method>
<method cat='Core' type='jQuery' short='将匹配的元素集合缩减为一个元素。' name='eq'>
<cndesc>
将匹配的元素集合缩减为一个元素。
这个元素在匹配元素集合中的位置变为0，而长度变成1。
</cndesc>
<desc>Reduce the set of matched elements to a single element.
The position of the element in the set of matched elements
starts at 0 and goes to length - 1.</desc>
<params type='Number' name='pos'>
<desc>要保留的元素的索引</desc>
</params>
<examples>
<code>$("p").eq(1)</code>
<result>[ &lt;p&gt;So is this&lt;/p&gt; ]</result>
<before>&lt;p&gt;This is just a test.&lt;/p&gt;&lt;p&gt;So is this&lt;/p&gt;</before>
</examples>
</method>
<method cat='Core' type='jQuery' short='将匹配的元素集合缩减为给定位置之前的所有元素。' name='lt'>
<cndesc>
将匹配的元素集合缩减为给定位置之前的所有元素。
这个元素在匹配元素集合中的位置变为0，而长度变成1。
</cndesc>
<desc>Reduce the set of matched elements to all elements before a given position.
The position of the element in the set of matched elements
starts at 0 and goes to length - 1.</desc>
<params type='Number' name='pos'>
<desc>把集合缩减为这个位置之下的所有元素</desc>
</params>
<examples>
<code>$("p").lt(1)</code>
<result>[ &lt;p&gt;This is just a test.&lt;/p&gt; ]</result>
<before>&lt;p&gt;This is just a test.&lt;/p&gt;&lt;p&gt;So is this&lt;/p&gt;</before>
</examples>
</method>
<method cat='Core' type='jQuery' short='将匹配的元素集合缩减为给定位置之后的所有元素。' name='gt'>
<cndesc>
将匹配的元素集合缩减为给定位置之后的所有元素。
这个元素在匹配元素集合中的位置变为0，而长度变成1。
</cndesc>
<desc>Reduce the set of matched elements to all elements after a given position.
The position of the element in the set of matched elements
starts at 0 and goes to length - 1.</desc>
<params type='Number' name='pos'>
<desc>把集合缩减为这个位置之后的所有元素</desc>
</params>
<examples>
<code>$("p").gt(0)</code>
<result>[ &lt;p&gt;So is this&lt;/p&gt; ]</result>
<before>&lt;p&gt;This is just a test.&lt;/p&gt;&lt;p&gt;So is this&lt;/p&gt;</before>
</examples>
</method>
<method cat='Core' type='Array&lt;Element&gt;' short='' private='1' name='$.find'>
<desc></desc>
</method>
</cat>

<cat value='DOM'>
<cat value='Attributes'>
<method cat='DOM/Attributes' type='Object' short='取得第一个匹配元素的属性值。' name='attr'>
<cndesc>
取得第一个匹配元素的属性值。
通过这个方法可以方便地从第一个匹配元素中获取一个属性的值。
</cndesc>
<desc>Access a property on the first matched element.
This method makes it easy to retrieve a property value
from the first matched element.</desc>
<params type='String' name='name'>
<desc>属性名称</desc>
</params>
<examples>
<desc>返回文档中第一个图像的src属性值。</desc>
<before>&lt;img src="test.jpg"/&gt;</before>
<code>$("img").attr("src");</code>
<result>test.jpg</result>
</examples>
</method>
<method cat='DOM/Attributes' type='jQuery' short='将一个“名/值”形式的对象设置为所有匹配元素的属性。' name='attr'>
<cndesc>
将一个“名/值”形式的对象设置为所有匹配元素的属性。

这是一种在所有匹配元素中批量设置很多属性的最佳方式。
</cndesc>
<desc>Set a key/value object as properties to all matched elements.

This serves as the best way to set a large number of properties
on all matched elements.</desc>
<params type='Map' name='properties'>
<desc>作为属性的“名/值对”对象</desc>
</params>
<examples>
<desc>为所有图像设置src和alt属性。</desc>
<before>&lt;img/&gt;</before>
<code>$("img").attr({ src: "test.jpg", alt: "Test Image" });</code>
<result>&lt;img src="test.jpg" alt="Test Image"/&gt;</result>
</examples>
</method>
<method cat='DOM/Attributes' type='jQuery' short='为所有匹配的元素设置一个属性值。' name='attr'>
<cndesc>
为所有匹配的元素设置一个属性值。

可以是由${规则}表达式提供的计算值，见示例2。

注意，不能在IE中设置input元素的name属性。
可以使用$(html)或.append(html)或.html(html)动态地创建包含name属性的input元素。
</cndesc>
<desc>Set a single property to a value, on all matched elements.

Can compute values provided as ${formula}, see second example.

Note that you can't set the name property of input elements in IE.
Use $(html) or .append(html) or .html(html) to create elements
on the fly including the name property.</desc>
<params type='String' name='key'>
<desc>要设置的属性名</desc>
</params>
<params type='Object' name='value'>
<desc>要设置的值</desc>
</params>
<examples>
<desc>为所有图像设置src属性。</desc>
<before>&lt;img/&gt;</before>
<code>$("img").attr("src","test.jpg");</code>
<result>&lt;img src="test.jpg"/&gt;</result>
</examples>
<examples>
<desc>以src属性的值作为title属性的值。使用了attr(String,Function)的简写方式。</desc>
<before>&lt;img src="test.jpg" /&gt;</before>
<code>$("img").attr("title", "${this.src}");</code>
<result>&lt;img src="test.jpg" title="test.jpg" /&gt;</result>
</examples>
</method>
<method cat='DOM/Attributes' type='jQuery' short='为所有匹配的元素设置一个计算的属性值。' name='attr'>
<cndesc>
为所有匹配的元素设置一个计算的属性值。

不提供值，而是提供一个函数，由这个函数计算的值作为属性值。
</cndesc>
<desc>Set a single property to a computed value, on all matched elements.

Instead of a value, a function is provided, that computes the value.</desc>
<params type='String' name='key'>
<desc>要设置的属性名称</desc>
</params>
<params type='Function' name='value'>
<desc>返回值的函数</desc>
</params>
<examples>
<desc>把src属性的值设置为title属性的值。</desc>
<before>&lt;img src="test.jpg" /&gt;</before>
<code>$("img").attr("title", function() { return this.src });</code>
<result>&lt;img src="test.jpg" title="test.jpg" /&gt;</result>
</examples>
</method>
<method cat='DOM/Attributes' type='String' short='取得所有匹配元素的内容。' name='text'>
<cndesc>
取得所有匹配元素的内容。
结果是由所有匹配元素包含的文本内容组合起来的文本。
这个方法对HTML和XML文档都有效。
</cndesc>
<desc>Get the text contents of all matched elements. The result is
a string that contains the combined text contents of all matched
elements. This method works on both HTML and XML documents.</desc>
<examples>
<desc>取得所有段落中文本内容的组合。</desc>
<before>&lt;p&gt;&lt;b&gt;Test&lt;/b&gt; Paragraph.&lt;/p&gt;&lt;p&gt;Paraparagraph&lt;/p&gt;</before>
<code>$("p").text();</code>
<result>Test Paragraph.Paraparagraph</result>
</examples>
</method>
<method cat='DOM/Attributes' type='String' short='设置所有匹配元素的文本内容。' name='text'>
<cndesc>
设置所有匹配元素的文本内容。
这个函数与html()函数具有同样的效果。
</cndesc>
<desc>Set the text contents of all matched elements. This has the same
effect as html().</desc>
<params type='String' name='val'>
<desc>文本内容</desc>
</params>
<examples>
<desc>设置所有段落的文本内容。</desc>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").text("Some new text.");</code>
<result>&lt;p&gt;Some new text.&lt;/p&gt;</result>
</examples>
</method>
<method cat='DOM/Attributes' type='String' short='获得第一个匹配元素的当前值。' name='val'>
<cndesc>
获得第一个匹配元素的当前值。
</cndesc>
<desc>Get the current value of the first matched element.</desc>
<examples>
<code>$("input").val();</code>
<result>"some text"</result>
<before>&lt;input type="text" value="some text"/&gt;</before>
</examples>
</method>
<method cat='DOM/Attributes' type='jQuery' short='设置每一个匹配元素的值。' name='val'>
<cndesc>
设置每一个匹配元素的值。
</cndesc>
<desc>Set the value of every matched element.</desc>
<params type='String' name='val'>
<desc>要设置的值。</desc>
</params>
<examples>
<code>$("input").val("test");</code>
<result>&lt;input type="text" value="test"/&gt;</result>
<before>&lt;input type="text" value="some text"/&gt;</before>
</examples>
</method>
<method cat='DOM/Attributes' type='String' short='取得第一个匹配元素的html内容。' name='html'>
<cndesc>
取得第一个匹配元素的html内容。
这个函数不能用于XML文档。
</cndesc>
<desc>Get the html contents of the first matched element.
This property is not available on XML documents.</desc>
<examples>
<code>$("div").html();</code>
<result>&lt;input/&gt;</result>
<before>&lt;div&gt;&lt;input/&gt;&lt;/div&gt;</before>
</examples>
</method>
<method cat='DOM/Attributes' type='jQuery' short='设置每一个匹配元素的html内容。' name='html'>
<cndesc>
设置每一个匹配元素的html内容。
这个函数不能用于XML文档。
</cndesc>
<desc>Set the html contents of every matched element.
This property is not available on XML documents.</desc>
<params type='String' name='val'>
<desc>Set the html contents to the specified value.</desc>
</params>
<examples>
<code>$("div").html("&lt;b&gt;new stuff&lt;/b&gt;");</code>
<result>&lt;div&gt;&lt;b&gt;new stuff&lt;/b&gt;&lt;/div&gt;</result>
<before>&lt;div&gt;&lt;input/&gt;&lt;/div&gt;</before>
</examples>
</method>
<method cat='DOM/Attributes' type='jQuery' short='从每一个匹配的元素中删除一个属性。' name='removeAttr'>
<cndesc>
从每一个匹配的元素中删除一个属性。
</cndesc>
<desc>Remove an attribute from each of the matched elements.</desc>
<params type='String' name='name'>
<desc>要删除的属性名</desc>
</params>
<examples>
<code>$("input").removeAttr("disabled")</code>
<result>&lt;input/&gt;</result>
<before>&lt;input disabled="disabled"/&gt;</before>
</examples>
</method>
<method cat='DOM/Attributes' type='jQuery' see='removeClass(String)' short='为每个匹配的元素添加指定的类名。' name='addClass'>
<cndesc>
为每个匹配的元素添加指定的类名。
</cndesc>
<desc>Adds the specified class to each of the set of matched elements.</desc>
<params type='String' name='class'>
<desc>要添加到元素中的CSS类名</desc>
</params>
<examples>
<code>$("p").addClass("selected")</code>
<result>[ &lt;p class="selected"&gt;Hello&lt;/p&gt; ]</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='DOM/Attributes' type='jQuery' see='addClass(String)' short='从所有匹配的元素中删除全部或者指定的类。' name='removeClass'>
<cndesc>
从所有匹配的元素中删除全部或者指定的类。
</cndesc>
<desc>Removes all or the specified class from the set of matched elements.</desc>
<params type='String' name='class'>
<desc>(可选) 要删除的类名</desc>
</params>
<examples>
<code>$("p").removeClass()</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
<before>&lt;p class="selected"&gt;Hello&lt;/p&gt;</before>
</examples>
<examples>
<code>$("p").removeClass("selected")</code>
<result>[ &lt;p class="first"&gt;Hello&lt;/p&gt; ]</result>
<before>&lt;p class="selected first"&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='DOM/Attributes' type='jQuery' short='如果存在（不存在）就删除（添加）一个类。' name='toggleClass'>
<cndesc>
如果存在（不存在）就删除（添加）一个类。
</cndesc>
<desc>Adds the specified class if it is not present, removes it if it is
present.</desc>
<params type='String' name='class'>
<desc>CSS类名</desc>
</params>
<examples>
<code>$("p").toggleClass("selected")</code>
<result>[ &lt;p class="selected"&gt;Hello&lt;/p&gt;, &lt;p&gt;Hello Again&lt;/p&gt; ]</result>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;</before>
</examples>
</method>
</cat>
<cat value='Manipulation'>
<method cat='DOM/Manipulation' type='jQuery' short='把所有匹配的元素用其他元素的结构化标记包装起来。' name='wrap'>
<cndesc>
把所有匹配的元素用其他元素的结构化标记包装起来。
这种包装对于在文档中插入额外的结构化标记最有用，而且它不会破坏原始文档的语义品质。

这个函数的原理是检查提供的第一个元素（它是由所提供的HTML标记代码动态生成的），
并在它的代码结构中找到最上层的祖先元素－－这个祖先元素就是包装元素。

当HTML标记代码中的元素包含文本时无法使用这个函数。因此，如果要添加文本应该在包装完成之后再行添加。
</cndesc>
<desc>Wrap all matched elements with a structure of other elements.
This wrapping process is most useful for injecting additional
stucture into a document, without ruining the original semantic
qualities of a document.

This works by going through the first element
provided (which is generated, on the fly, from the provided HTML)
and finds the deepest ancestor element within its
structure - it is that element that will en-wrap everything else.

This does not work with elements that contain text. Any necessary text
must be added after the wrapping is done.</desc>
<params type='String' name='html'>
<desc>HTML标记代码字符串，用于动态生成元素并包装目标元素</desc>
</params>
<examples>
<code>$("p").wrap("&lt;div class='wrap'&gt;&lt;/div&gt;");</code>
<result>&lt;div class='wrap'&gt;&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;/div&gt;</result>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='把所有匹配的元素用其他元素的结构化标记包装起来。' name='wrap'>
<cndesc>
把所有匹配的元素用其他元素的结构化标记包装起来。
这种包装对于在文档中插入额外的结构化标记最有用，而且它不会破坏原始文档的语义品质。

这个函数的原理是检查提供的第一个元素并在它的代码结构中找到最上层的祖先元素－－这个祖先元素就是包装元素。

当HTML标记代码中的元素包含文本时无法使用这个函数。因此，如果要添加文本应该在包装完成之后再行添加。
</cndesc>
<desc>Wrap all matched elements with a structure of other elements.
This wrapping process is most useful for injecting additional
stucture into a document, without ruining the original semantic
qualities of a document.

This works by going through the first element
provided and finding the deepest ancestor element within its
structure - it is that element that will en-wrap everything else.

This does not work with elements that contain text. Any necessary text
must be added after the wrapping is done.</desc>
<params type='Element' name='elem'>
<desc>用于包装目标元素的DOM元素</desc>
</params>
<examples>
<code>$("p").wrap( document.getElementById('content') );</code>
<result>&lt;div id="content"&gt;&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;/div&gt;</result>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;div id="content"&gt;&lt;/div&gt;</before>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='向每个匹配的元素内部追加内容。' name='append'>
<cndesc>
向每个匹配的元素内部追加内容。

这个操作与对指定的元素执行appendChild方法，将它们添加到文档中的情况类似。
</cndesc>
<desc>Append content to the inside of every matched element.

This operation is similar to doing an appendChild to all the
specified elements, adding them into the document.</desc>
<see>prepend(&lt;Content&gt;)</see>
<see>before(&lt;Content&gt;)</see>
<see>after(&lt;Content&gt;)</see>
<params type='&lt;Content&gt;' name='content'>
<desc>要追加到目标中的内容</desc>
</params>
<examples>
<desc>向所有段落中追加一些HTML标记。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;</before>
<code>$("p").append("&lt;b&gt;Hello&lt;/b&gt;");</code>
<result>&lt;p&gt;I would like to say: &lt;b&gt;Hello&lt;/b&gt;&lt;/p&gt;</result>
</examples>
<examples>
<desc>向所有段落中追加一个元素。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</before>
<code>$("p").append( $("#foo")[0] );</code>
<result>&lt;p&gt;I would like to say: &lt;b id="foo"&gt;Hello&lt;/b&gt;&lt;/p&gt;</result>
</examples>
<examples>
<desc>向所有段落中追加一个jQuery对象(类似于一个DOM元素数组)。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</before>
<code>$("p").append( $("b") );</code>
<result>&lt;p&gt;I would like to say: &lt;b&gt;Hello&lt;/b&gt;&lt;/p&gt;</result>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='向每个匹配的元素内部前置内容。' name='prepend'>
<cndesc>
向每个匹配的元素内部前置内容。

这是向所有匹配元素内部的开始处插入内容的最佳方式。
</cndesc>
<desc>Prepend content to the inside of every matched element.

This operation is the best way to insert elements
inside, at the beginning, of all matched elements.</desc>
<see>append(&lt;Content&gt;)</see>
<see>before(&lt;Content&gt;)</see>
<see>after(&lt;Content&gt;)</see>
<params type='&lt;Content&gt;' name='content'>
<desc>要插入到目标元素内部前端的内容</desc>
</params>
<examples>
<desc>向所有段落中前置一些HTML标记代码。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;</before>
<code>$("p").prepend("&lt;b&gt;Hello&lt;/b&gt;");</code>
<result>&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;I would like to say: &lt;/p&gt;</result>
</examples>
<examples>
<desc>向所有段落中前置一个元素。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</before>
<code>$("p").prepend( $("#foo")[0] );</code>
<result>&lt;p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;I would like to say: &lt;/p&gt;</result>
</examples>
<examples>
<desc>向所有段落中前置一个jQuery对象(类似于一个DOM元素数组)。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</before>
<code>$("p").prepend( $("b") );</code>
<result>&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;I would like to say: &lt;/p&gt;</result>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='在每个匹配的元素之前插入内容。' name='before'>
<cndesc>
在每个匹配的元素之前插入内容。
</cndesc>
<desc>Insert content before each of the matched elements.</desc>
<see>append(&lt;Content&gt;)</see>
<see>prepend(&lt;Content&gt;)</see>
<see>after(&lt;Content&gt;)</see>
<params type='&lt;Content&gt;' name='content'>
<desc>插入到每个目标前的内容</desc>
</params>
<examples>
<desc>在所有段落之前插入一些HTML标记代码。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;</before>
<code>$("p").before("&lt;b&gt;Hello&lt;/b&gt;");</code>
<result>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result>
</examples>
<examples>
<desc>在所有段落之前插入一个元素。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</before>
<code>$("p").before( $("#foo")[0] );</code>
<result>&lt;b id="foo"&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result>
</examples>
<examples>
<desc>在所有段落中前插入一个jQuery对象(类似于一个DOM元素数组)。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</before>
<code>$("p").before( $("b") );</code>
<result>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='在每个匹配的元素之后插入内容。' name='after'>
<cndesc>
在每个匹配的元素之后插入内容。
</cndesc>
<desc>Insert content after each of the matched elements.</desc>
<see>append(&lt;Content&gt;)</see>
<see>prepend(&lt;Content&gt;)</see>
<see>before(&lt;Content&gt;)</see>
<params type='&lt;Content&gt;' name='content'>
<desc>插入到每个目标后的内容</desc>
</params>
<examples>
<desc>在所有段落之后插入一些HTML标记代码。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;</before>
<code>$("p").after("&lt;b&gt;Hello&lt;/b&gt;");</code>
<result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</result>
</examples>
<examples>
<desc>在所有段落之后插入一个元素。</desc>
<before>&lt;b id="foo"&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</before>
<code>$("p").after( $("#foo")[0] );</code>
<result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</result>
</examples>
<examples>
<desc>在所有段落中后插入一个jQuery对象(类似于一个DOM元素数组)。</desc>
<before>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</before>
<code>$("p").after( $("b") );</code>
<result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</result>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='克隆匹配的DOM元素并且选中这些克隆的副本。' name='clone'>
<cndesc>
克隆匹配的DOM元素并且选中这些克隆的副本。

在想把DOM文档中元素的副本添加到其他位置时这个函数非常有用。
</cndesc>
<desc>Clone matched DOM Elements and select the clones.

This is useful for moving copies of the elements to another
location in the DOM.</desc>
<examples>
<desc>克隆所有b元素（并选中这些克隆的副本），然后将它们前置到所有段落中。</desc>
<before>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;, how are you?&lt;/p&gt;</before>
<code>$("b").clone().prependTo("p");</code>
<result>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;, how are you?&lt;/p&gt;</result>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='把所有匹配的元素追加到另一个、指定的元素元素集合中。' name='appendTo'>
<cndesc>
把所有匹配的元素追加到另一个、指定的元素元素集合中。
实际上，使用这个方法是颠倒了常规的$(A).append(B)的操作，即不是把B追加到A中，而是把A追加到B中。
</cndesc>
<desc>Append all of the matched elements to another, specified, set of elements.
This operation is, essentially, the reverse of doing a regular
$(A).append(B), in that instead of appending B to A, you're appending
A to B.</desc>
<params type='String' name='expr'>
<desc>用于匹配元素的jQuery表达式</desc>
</params>
<examples>
<desc>把所有段落追加到ID值为foo的元素中。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;div id="foo"&gt;&lt;/div&gt;</before>
<code>$("p").appendTo("#foo");</code>
<result>&lt;div id="foo"&gt;&lt;p&gt;I would like to say: &lt;/p&gt;&lt;/div&gt;</result>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='把所有匹配的元素前置到另一个、指定的元素元素集合中。' name='prependTo'>
<cndesc>
把所有匹配的元素前置到另一个、指定的元素元素集合中。
实际上，使用这个方法是颠倒了常规的$(A).prepend(B)的操作，即不是把B前置到A中，而是把A前置到B中。
</cndesc>
<desc>Prepend all of the matched elements to another, specified, set of elements.
This operation is, essentially, the reverse of doing a regular
$(A).prepend(B), in that instead of prepending B to A, you're prepending
A to B.</desc>
<params type='String' name='expr'>
<desc>用于匹配元素的jQuery表达式</desc>
</params>
<examples>
<desc>把所有段落前置到ID值为foo的元素中。</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;div id="foo"&gt;&lt;b&gt;Hello&lt;/b&gt;&lt;/div&gt;</before>
<code>$("p").prependTo("#foo");</code>
<result>&lt;div id="foo"&gt;&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;&lt;/div&gt;</result>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='把所有匹配的元素插入到另一个、指定的元素元素集合的前面。' name='insertBefore'>
<cndesc>
把所有匹配的元素插入到另一个、指定的元素元素集合的前面。
实际上，使用这个方法是颠倒了常规的$(A).before(B)的操作，即不是把B插入到A前面，而是把A插入到B前面。
</cndesc>
<desc>Insert all of the matched elements before another, specified, set of elements.
This operation is, essentially, the reverse of doing a regular
$(A).before(B), in that instead of inserting B before A, you're inserting
A before B.</desc>
<params type='String' name='expr'>
<desc>用于匹配元素的jQuery表达式</desc>
</params>
<examples>
<desc>与 $("#foo").before("p")相同</desc>
<before>&lt;div id="foo"&gt;Hello&lt;/div&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</before>
<code>$("p").insertBefore("#foo");</code>
<result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;div id="foo"&gt;Hello&lt;/div&gt;</result>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='把所有匹配的元素插入到另一个、指定的元素元素集合的后面。' name='insertAfter'>
<cndesc>
把所有匹配的元素插入到另一个、指定的元素元素集合的后面。
实际上，使用这个方法是颠倒了常规的$(A).after(B)的操作，即不是把B插入到A后面，而是把A插入到B后面。
</cndesc>
<desc>Insert all of the matched elements after another, specified, set of elements.
This operation is, essentially, the reverse of doing a regular
$(A).after(B), in that instead of inserting B after A, you're inserting
A after B.</desc>
<params type='String' name='expr'>
<desc>用于匹配元素的jQuery表达式</desc>
</params>
<examples>
<desc>与 $("#foo").after("p")相同</desc>
<before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;div id="foo"&gt;Hello&lt;/div&gt;</before>
<code>$("p").insertAfter("#foo");</code>
<result>&lt;div id="foo"&gt;Hello&lt;/div&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='从DOM中删除所有匹配的元素。' name='remove'>
<cndesc>
从DOM中删除所有匹配的元素。这个方法不会把匹配的元素从jQuery对象中删除，因而可以在将来再使用这些匹配的元素。

可以通过一个可选的表达式对要删除的元素进行筛选。
</cndesc>
<desc>Removes all matched elements from the DOM. This does NOT remove them from the
jQuery object, allowing you to use the matched elements further.

Can be filtered with an optional expressions.</desc>
<params type='String' name='expr'>
<desc>(可选)用于筛选元素的jQuery表达式</desc>
</params>
<examples>
<code>$("p").remove();</code>
<result>how are</result>
<before>&lt;p&gt;Hello&lt;/p&gt; how are &lt;p&gt;you?&lt;/p&gt;</before>
</examples>
<examples>
<code>$("p").remove(".hello");</code>
<result>how are &lt;p&gt;you?&lt;/p&gt;</result>
<before>&lt;p class="hello"&gt;Hello&lt;/p&gt; how are &lt;p&gt;you?&lt;/p&gt;</before>
</examples>
</method>
<method cat='DOM/Manipulation' type='jQuery' short='删除匹配的元素集合中所有的子节点。' name='empty'>
<cndesc>
删除匹配的元素集合中所有的子节点。
</cndesc>
<desc>Removes all child nodes from the set of matched elements.</desc>
<examples>
<code>$("p").empty()</code>
<result>[ &lt;p&gt;&lt;/p&gt; ]</result>
<before>&lt;p&gt;Hello, &lt;span&gt;Person&lt;/span&gt; &lt;a href="#"&gt;and person&lt;/a&gt;&lt;/p&gt;</before>
</examples>
</method>
</cat>
<cat value='Traversing'>
<method cat='DOM/Traversing' type='jQuery' short='结束最近的“破坏性”操作，把匹配的元素列表回复到前一个状态。' name='end'>
<cndesc>
结束最近的“破坏性”操作，把匹配的元素列表回复到前一个状态。
在调用end函数后，匹配的元素列表会回复到上一个操作之前的匹配元素列表状态。

如果前面的操作（对元素列表的状态）没有破坏性，则什么也不改变。
</cndesc>
<desc>End the most recent 'destructive' operation, reverting the list of matched elements
back to its previous state. After an end operation, the list of matched elements will
revert to the last state of matched elements.

If there was no destructive operation before, an empty set is returned.</desc>
<examples>
<desc>选择所有段落，并在它们中查找span元素，然后恢回复到选择所有段落的状态。</desc>
<before>&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;, how are you?&lt;/p&gt;</before>
<code>$("p").find("span").end();</code>
<result>[ &lt;p&gt;...&lt;/p&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='搜索所有与指定表达式匹配的元素。' name='find'>
<cndesc>
搜索所有与指定表达式匹配的元素。
这个函数是找出正在处理的元素的后代元素的好方法。

所有搜索都依靠jQuery表达式来完成。这个表达式可以使用CSS1-3的选择符语法或基本的XPath语法来写。
</cndesc>
<desc>Searches for all elements that match the specified expression.
This method is a good way to find additional descendant
elements with which to process.

All searching is done using a jQuery expression. The expression can be
written using CSS 1-3 Selector syntax, or basic XPath.</desc>
<params type='String' name='expr'>
<desc>用于搜索的表达式</desc>
</params>
<examples>
<desc>从所有的段落开始，进一步搜索下面的span元素。与$("p span")相同。</desc>
<before>&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;, how are you?&lt;/p&gt;</before>
<code>$("p").find("span");</code>
<result>[ &lt;span&gt;Hello&lt;/span&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='从所有匹配的元素集合中删除那些与指定的表达式（可以是多个）不匹配的元素。' name='filter'>
<cndesc>
从所有匹配的元素集合中删除那些与指定的表达式（可以是多个）不匹配的元素。这个方法用于缩小匹配的范围。

使用表达式字符串数组可以实现一次完成多重筛选的效果。
</cndesc>
<desc>Removes all elements from the set of matched elements that do not
match the specified expression(s). This method is used to narrow down
the results of a search.

Provide a String array of expressions to apply multiple filters at once.</desc>
<params type='String|Array&lt;String&gt;' name='expression'>
<desc>要搜索的表达式（或表达式数组）</desc>
</params>
<examples>
<desc>选择所有段落并删除那些类名不是selected的元素。</desc>
<before>&lt;p class="selected"&gt;Hello&lt;/p&gt;&lt;p&gt;How are you?&lt;/p&gt;</before>
<code>$("p").filter(".selected")</code>
<result>[ &lt;p class="selected"&gt;Hello&lt;/p&gt; ]</result>
</examples>
<examples>
<desc>选择所有段落并删除那些类名不是selected的元素，但不删除第一个元素。</desc>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;p class="selected"&gt;And Again&lt;/p&gt;</before>
<code>$("p").filter([".selected", ":first"])</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;p class="selected"&gt;And Again&lt;/p&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='从匹配的元素集合中删除那些不符合指定的筛选条件的元素。' name='filter'>
<cndesc>
从匹配的元素集合中删除那些不符合指定的筛选条件的元素。这个方法用于缩小搜索的范围。
</cndesc>
<desc>Removes all elements from the set of matched elements that do not
pass the specified filter. This method is used to narrow down
the results of a search.</desc>
<params type='Function' name='filter'>
<desc>作为筛选条件的函数</desc>
</params>
<examples>
<desc>删除所有拥有一个ol子元素的元素。</desc>
<before>&lt;p&gt;&lt;ol&gt;&lt;li&gt;Hello&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;p&gt;How are you?&lt;/p&gt;</before>
<code>$("p").filter(function(index) {
  return $("ol", this).length == 0;
})</code>
<result>[ &lt;p&gt;How are you?&lt;/p&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='从匹配的元素集合中删除指定的元素。' name='not'>
<cndesc>
从匹配的元素集合中删除指定的元素。这个方法用于从一个jQuery对象中删除一个元素。
</cndesc>
<desc>Removes the specified Element from the set of matched elements. This
method is used to remove a single Element from a jQuery object.</desc>
<params type='Element' name='el'>
<desc>要删除的元素</desc>
</params>
<examples>
<desc>从所有的段落集合中删除ID为selected的元素。</desc>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p id="selected"&gt;Hello Again&lt;/p&gt;</before>
<code>$("p").not( $("#selected")[0] )</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='从匹配的元素集合中删除与指定的表达式匹配的元素。' name='not'>
<cndesc>
从匹配的元素集合中删除与指定的表达式匹配的元素。这个方法用于从一个jQuery对象中删除一个或多个元素。
</cndesc>
<desc>Removes elements matching the specified expression from the set
of matched elements. This method is used to remove one or more
elements from a jQuery object.</desc>
<params type='String' name='expr'>
<desc>用于删除匹配的元素的表达式</desc>
</params>
<examples>
<desc>从所有段落的集合中删除ID为selected的元素。</desc>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p id="selected"&gt;Hello Again&lt;/p&gt;</before>
<code>$("p").not("#selected")</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='把与表达式匹配的元素添加到jQuery对象中。' name='add'>
<cndesc>
把与表达式匹配的元素添加到jQuery对象中。这个函数可以用于连接分别与两个表达式匹配的元素结果集。
</cndesc>
<desc>Adds the elements matched by the expression to the jQuery object. This
can be used to concatenate the result sets of two expressions.</desc>
<params type='String' name='expr'>
<desc>用于匹配相加结果元素的表达式</desc>
</params>
<examples>

<code>$("p").add("span")</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;span&gt;Hello Again&lt;/span&gt; ]</result>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/p&gt;</before>

</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='把一个或多个元素添加到匹配的元素集合中。' name='add'>
<cndesc>
把一个或多个元素添加到匹配的元素集合中。

这个函数用于把一个元素集合添加到一个jQuery对象中。
</cndesc>
<desc>Adds one or more Elements to the set of matched elements.

This is used to add a set of Elements to a jQuery object.</desc>
<params type='Element|Array&lt;Element&gt;' name='elements'>
<desc>要添加的一个或多个元素</desc>
</params>
<examples>
<code>$("p").add( document.getElementById("a") )</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;span id="a"&gt;Hello Again&lt;/span&gt; ]</result>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;&lt;span id="a"&gt;Hello Again&lt;/span&gt;&lt;/p&gt;</before>
</examples>
<examples>
<code>$("p").add([document.getElementById("a"), document.getElementById("b")])</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;span id="a"&gt;Hello Again&lt;/span&gt;, &lt;span id="b"&gt;And Again&lt;/span&gt; ]</result>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;&lt;span id="a"&gt;Hello Again&lt;/span&gt;&lt;span id="b"&gt;And Again&lt;/span&gt;&lt;/p&gt;</before>
</examples>
</method>
<method cat='DOM/Traversing' type='Boolean' short='用一个表达式来检查当前选择的元素集合，如果其中至少有一个元素符合这个给定的表达式就返回true。' name='is'>
<cndesc>
用一个表达式来检查当前选择的元素集合，如果其中至少有一个元素符合这个给定的表达式就返回true。

如果没有元素符合这个表达式，或者表达式是无效的，都返回false。

在内部可以使用filter(String)函数，因此filter()函数原先的规则在这里也适用。
</cndesc>
<desc>Checks the current selection against an expression and returns true,
if at least one element of the selection fits the given expression.

Does return false, if no element fits or the expression is not valid.

filter(String) is used internally, therefore all rules that apply there
apply here, too.</desc>
<params type='String' name='expr'>
<desc>用于筛选的表达式</desc>
</params>
<examples>
<desc>因为input元素的父元素是一个表单元素，所以返回true。</desc>
<before>&lt;form&gt;&lt;input type="checkbox" /&gt;&lt;/form&gt;</before>
<code>$("input[@type='checkbox']").parent().is("form")</code>
<result>true</result>
</examples>
<examples>
<desc>因为input元素的父元素是一个p元素，所以返回false。</desc>
<before>&lt;form&gt;&lt;p&gt;&lt;input type="checkbox" /&gt;&lt;/p&gt;&lt;/form&gt;</before>
<code>$("input[@type='checkbox']").parent().is("form")</code>
<result>false</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='取得一个包含着所有匹配元素的唯一父元素的元素集合。' name='parent'>
<cndesc>
取得一个包含着所有匹配元素的唯一父元素的元素集合。

可以通过一个可选的表达式进行筛选。
</cndesc>
<desc>Get a set of elements containing the unique parents of the matched
set of elements.

Can be filtered with an optional expressions.</desc>
<params type='String' name='expr'>
<desc>(可选) 用于筛选父元素的表达式</desc>
</params>
<examples>
<desc>找到每个段落的父元素。</desc>
<before>&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt;</before>
<code>$("p").parent()</code>
<result>[ &lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt; ]</result>
</examples>
<examples>
<desc>找到段落的父元素中每个类名为selected的父元素。</desc>
<before>&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt;&lt;div class="selected"&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;/div&gt;</before>
<code>$("p").parent(".selected")</code>
<result>[ &lt;div class="selected"&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;/div&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='取得一个包含着所有匹配元素的唯一祖先元素的元素集合（不包含根元素）。' name='parents'>
<cndesc>
取得一个包含着所有匹配元素的唯一祖先元素的元素集合（不包含根元素）。

可以通过一个可选的表达式进行筛选。
</cndesc>
<desc>Get a set of elements containing the unique ancestors of the matched
set of elements (except for the root element).

Can be filtered with an optional expressions.</desc>
<params type='String' name='expr'>
<desc>(可选) 用于筛选祖先元素的表达式</desc>
</params>
<examples>
<desc>找到每个span元素的父元素。</desc>
<before>&lt;html&gt;&lt;body&gt;&lt;div&gt;&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/p&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</before>
<code>$("span").parents()</code>
<result>[ &lt;body&gt;...&lt;/body&gt;, &lt;div&gt;...&lt;/div&gt;, &lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/p&gt; ]</result>
</examples>
<examples>
<desc>找到每个span元素的父元素中是p元素的元素。</desc>
<before>&lt;html&gt;&lt;body&gt;&lt;div&gt;&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/p&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</before>
<code>$("span").parents("p")</code>
<result>[ &lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/p&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='取得一个包含匹配的元素集合中每一个元素紧邻的后面同辈元素的元素集合。' name='next'>
<cndesc>
取得一个包含匹配的元素集合中每一个元素紧邻的后面同辈元素的元素集合。

这个函数只返回后面那个紧邻的同辈元素，而不是后面所有的同辈元素。

可以用一个可选的表达式进行筛选。
</cndesc>
<desc>Get a set of elements containing the unique next siblings of each of the
matched set of elements.

It only returns the very next sibling, not all next siblings.

Can be filtered with an optional expressions.</desc>
<params type='String' name='expr'>
<desc>(可选) 用于筛选后面同辈元素的表达式</desc>
</params>
<examples>
<desc>找到每个段落的后面紧邻的同辈元素。</desc>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt;</before>
<code>$("p").next()</code>
<result>[ &lt;p&gt;Hello Again&lt;/p&gt;, &lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt; ]</result>
</examples>
<examples>
<desc>找到类名为selected的每一个段落的后面紧邻的同辈元素。</desc>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt;</before>
<code>$("p").next(".selected")</code>
<result>[ &lt;p class="selected"&gt;Hello Again&lt;/p&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='取得一个包含匹配的元素集合中每一个元素紧邻的前一个同辈元素的元素集合。' name='prev'>
<cndesc>
取得一个包含匹配的元素集合中每一个元素紧邻的前一个同辈元素的元素集合。

可以用一个可选的表达式进行筛选。

这个函数只返回前一个紧邻的同辈元素，而不是前面所有的同辈元素。
</cndesc>
<desc>Get a set of elements containing the unique previous siblings of each of the
matched set of elements.

Can be filtered with an optional expressions.

It only returns the immediately previous sibling, not all previous siblings.</desc>
<params type='String' name='expr'>
<desc>(可选) 用于筛选前一个同辈元素的表达式</desc>
</params>
<examples>
<desc>找到每个段落紧邻的前一个同辈元素。</desc>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;div&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt;&lt;p&gt;And Again&lt;/p&gt;</before>
<code>$("p").prev()</code>
<result>[ &lt;div&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt; ]</result>
</examples>
<examples>
<desc>找到每个类名为selected的段落的前一个紧邻的同辈元素。</desc>
<before>&lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/div&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;p&gt;And Again&lt;/p&gt;</before>
<code>$("p").prev(".selected")</code>
<result>[ &lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/div&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='取得一个包含匹配的元素集合中每一个元素的所有唯一同辈元素的元素集合。' name='siblings'>
<cndesc>
取得一个包含匹配的元素集合中每一个元素的所有唯一同辈元素的元素集合。

可以用可选的表达式进行筛选。
</cndesc>
<desc>Get a set of elements containing all of the unique siblings of each of the
matched set of elements.

Can be filtered with an optional expressions.</desc>
<params type='String' name='expr'>
<desc>(可选) 用于筛选同辈元素的表达式</desc>
</params>
<examples>
<desc>找到每个div的所有同辈元素。</desc>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;div&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt;&lt;p&gt;And Again&lt;/p&gt;</before>
<code>$("div").siblings()</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;p&gt;And Again&lt;/p&gt; ]</result>
</examples>
<examples>
<desc>找到每个div的所有同辈元素中带有类名为selected的元素。</desc>
<before>&lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/div&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;p&gt;And Again&lt;/p&gt;</before>
<code>$("div").siblings(".selected")</code>
<result>[ &lt;p class="selected"&gt;Hello Again&lt;/p&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='取得一个包含匹配的元素集合中每一个元素的所有唯一子元素的元素集合。' name='children'>
<cndesc>
取得一个包含匹配的元素集合中每一个元素的所有唯一子元素的元素集合。

可以用可选的表达式进行筛选。
</cndesc>
<desc>Get a set of elements containing all of the unique children of each of the
matched set of elements.

Can be filtered with an optional expressions.</desc>
<params type='String' name='expr'>
<desc>(可选) 用于筛选子元素的表达式</desc>
</params>
<examples>
<desc>找到每个div的所有子元素。</desc>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;div&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt;&lt;p&gt;And Again&lt;/p&gt;</before>
<code>$("div").children()</code>
<result>[ &lt;span&gt;Hello Again&lt;/span&gt; ]</result>
</examples>
<examples>
<desc>找到每个div的所有子元素中带有类名为selected的元素。</desc>
<before>&lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;p&gt;And Again&lt;/p&gt;&lt;/div&gt;</before>
<code>$("div").children(".selected")</code>
<result>[ &lt;p class="selected"&gt;Hello Again&lt;/p&gt; ]</result>
</examples>
</method>
<method cat='DOM/Traversing' type='jQuery' short='把元素集合筛选为包含指定文本的元素。' name='contains'>
<cndesc>
把元素集合筛选为包含指定文本的元素。
</cndesc>
<desc>Filter the set of elements to those that contain the specified text.</desc>
<params type='String' name='str'>
<desc>包含在元素中的文本</desc>
</params>
<examples>
<code>$("p").contains("test")</code>
<result>[ &lt;p&gt;This is just a test.&lt;/p&gt; ]</result>
<before>&lt;p&gt;This is just a test.&lt;/p&gt;&lt;p&gt;So is this&lt;/p&gt;</before>
</examples>
</method>
<method cat='DOM/Traversing' type='Array&lt;Element&gt;' short='给定元素的所有祖先元素。' name='$.parents' private='1'>
<cndesc>
给定元素的所有祖先元素。
</cndesc>
<desc>All ancestors of a given element.</desc>
<params type='Element' name='elem'>
<desc>要查找其祖先元素的元素</desc>
</params>
</method>
<method cat='DOM/Traversing' type='DOMElement' short='沿特定的方向在指定的元素中搜索的快捷方式。' name='$.nth' private='1'>
<cndesc>
沿特定的方向在指定的元素中搜索的快捷方式。
</cndesc>
<desc>A handy, and fast, way to traverse in a particular direction and find
a specific element.</desc>
<params type='DOMElement' name='cur'>
<desc>要搜索的元素</desc>
</params>
<params type='Number|String' name='num'>
<desc>要匹配的第几个结果。可以是数字或字符串（如“even”或“odd”）</desc>
</params>
<params type='String' name='dir'>
<desc>查找的方向（例如“previousSibling”或“nextSibling”）</desc>
</params>
</method>
<method cat='DOM/Traversing' type='Array' short='在指定轴向上的所有元素。' name='$.sibling' private='1'>
<cndesc>
在指定轴向上的所有元素。
</cndesc>
<desc>All elements on a specified axis.</desc>
<params type='Element' name='elem'>
<desc>要查找其所有同辈元素的元素（包括其自身）</desc>
</params>
</method>
</cat>
</cat>
<cat value='CSS'>
<method cat='CSS' type='String' short='访问第一个匹配元素的样式属性。' name='css'>
<cndesc>
访问第一个匹配元素的样式属性。
使用这个方法可以很容易地取得第一个匹配元素的样式属性的值。
</cndesc>
<desc>Access a style property on the first matched element.
This method makes it easy to retrieve a style property value
from the first matched element.</desc>
<params type='String' name='name'>
<desc>要访问的属性名称</desc>
</params>
<examples>
<desc>取得第一个段落的color样式属性的值。</desc>
<before>&lt;p style="color:red;"&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").css("color");</code>
<result>"red"</result>
</examples>
<examples>
<desc>取得第一个段落的font-weight样式属性的值。</desc>
<before>&lt;p style="font-weight: bold;"&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").css("font-weight");</code>
<result>"bold"</result>
</examples>
</method>
<method cat='CSS' type='jQuery' short='把一个“名/值对”对象设置为所有匹配元素的样式属性。' name='css'>
<cndesc>
把一个“名/值对”对象设置为所有匹配元素的样式属性。

这是一种在所有匹配的元素上设置大量样式属性的最佳方式。
</cndesc>
<desc>Set a key/value object as style properties to all matched elements.

This serves as the best way to set a large number of style properties
on all matched elements.</desc>
<params type='Map' name='properties'>
<desc>要设置为样式属性的名/值对对象</desc>
</params>
<examples>
<desc>为所有p元素设置color和background样式属性。</desc>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").css({ color: "red", background: "blue" });</code>
<result>&lt;p style="color:red; background:blue;"&gt;Test Paragraph.&lt;/p&gt;</result>
</examples>
</method>
<method cat='CSS' type='jQuery' short='在所有匹配的元素中，设置一个样式属性的值。' name='css'>
<cndesc>
在所有匹配的元素中，设置一个样式属性的值。
</cndesc>
<desc>Set a single style property to a value, on all matched elements.</desc>
<params type='String' name='key'>
<desc>要设置的样式属性名称</desc>
</params>
<params type='Object' name='value'>
<desc>要设置的样式属性的值</desc>
</params>
<examples>
<desc>把所有段落的color样式属性值改为红色。</desc>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").css("color","red");</code>
<result>&lt;p style="color:red;"&gt;Test Paragraph.&lt;/p&gt;</result>
</examples>
</method>
</cat>
<cat value='JavaScript'>
<method cat='Javascript' type='Object' short='用一个或多个其他对象来扩展一个对象，返回这个被扩展的对象。' name='$.extend'>
<cndesc>
用一个或多个其他对象来扩展一个对象，返回这个被扩展的对象。
这是简化继承的主要工具。
</cndesc>
<desc>Extend one object with one or more others, returning the original,
modified, object. This is a great utility for simple inheritance.</desc>
<params type='Object' name='target'>
<desc>要扩展的对象</desc>
</params>
<params type='Object' name='prop1'>
<desc>要与第一个对象合并的对象</desc>
</params>
<params type='Object' name='propN'>
<desc>(可选) 更多要与第一个对象合并的对象</desc>
</params>
<examples>
<desc>合并settings和options, 修改并返回settings</desc>
<code>var settings = { validate: false, limit: 5, name: "foo" };
var options = { validate: true, name: "bar" };
jQuery.extend(settings, options);</code>

<result>settings == { validate: true, limit: 5, name: "bar" }</result>
</examples>
<examples>
<desc>合并defaults和options, 但不修改defaults，返回合并后的对象</desc>
<code>var defaults = { validate: false, limit: 5, name: "foo" };
var options = { validate: true, name: "bar" };
var settings = jQuery.extend({}, defaults, options);</code>
<result>settings == { validate: true, limit: 5, name: "bar" }</result>
</examples>
</method>
<method cat='JavaScript' type='Object' short='一个通用的迭代函数，可用于近似地迭代对象和数组。' name='$.each'>
<cndesc>
一个通用的迭代函数，可用于近似地迭代对象和数组。
这个函数与$().each()不同，$().each()是专门用于迭代和执行jQuery对象的函数。
而这个函数可以用于迭代任何对象和数组。

这个函数的回调中包含两个参数：第一个是key（对象）或index（数组），第二个是值。
</cndesc>
<desc>A generic iterator function, which can be used to seemlessly
iterate over both objects and arrays. This function is not the same
as $().each() - which is used to iterate, exclusively, over a jQuery
object. This function can be used to iterate over anything.

The callback has two arguments:the key (objects) or index (arrays) as first
the first, and the value as the second.</desc>
<params type='Object' name='obj'>
<desc>要重复迭代的对象或数组</desc>
</params>
<params type='Function' name='fn'>
<desc>要在每个对象中执行的函数</desc>
</params>
<examples>
<desc>这是一个迭代数组中所有项目的例子，通过函数访问了其中的每个项目和索引。</desc>
<code>$.each( [0,1,2], function(i, n){
  alert( "Item #" + i + ": " + n );
});</code>
</examples>
<examples>
<desc>这是一个迭代对象中所有属性的例子，通过函数访问了每个属性的名称和值。</desc>
<code>$.each( { name: "John", lang: "JS" }, function(i, n){
  alert( "Name: " + i + ", Value: " + n );
});</code>
</examples>
</method>
<method cat='JavaScript' type='String' short='删除字符串两端的空白字符。' name='$.trim'>
<cndesc>
删除字符串两端的空白字符。
</cndesc>
<desc>Remove the whitespace from the beginning and end of a string.</desc>
<params type='String' name='str'>
<desc>要删除空白字符的字符串</desc>
</params>
<examples>
<code>$.trim("  hello, how are you?  ");</code>
<result>"hello, how are you?"</result>
</examples>
</method>
<method cat='JavaScript' type='Array' short='合并两个数组，删除其中重复的项目。' name='$.merge'>
<cndesc>
合并两个数组，删除其中重复的项目。

得到的新数组是：第一个数组中的所有项目，加上第二个数组中唯一的（不与第一个数组中任何项目相同的）项目。
</cndesc>
<desc>Merge two arrays together, removing all duplicates.

The new array is: All the results from the first array, followed
by the unique results from the second array.</desc>
<params type='Array' name='first'>
<desc>要合并的第一个数组</desc>
</params>
<params type='Array' name='second'>
<desc>要合并的第二个数组</desc>
</params>
<examples>
<desc>合并两个数组，删除其中重复的2</desc>
<code>$.merge( [0,1,2], [2,3,4] )</code>
<result>[0,1,2,3,4]</result>
</examples>
<examples>
<desc>合并两个数组，删除重复的3和2。</desc>
<code>$.merge( [3,2,1], [4,3,2] )</code>
<result>[3,2,1,4]</result>
</examples>
</method>
<method cat='JavaScript' type='Array' short='使用筛选函数，从一个数组中筛选项目。' name='$.grep'>
<cndesc>
使用筛选函数，从一个数组中筛选项目。

其中筛选函数必须传递两个参数：数组中的当前项目和数组中项目的索引。
如果要保持数组中的项目，这个函数必须返回true；如果返回false，就会删除项目。
</cndesc>
<desc>Filter items out of an array, by using a filter function.

The specified function will be passed two arguments: The
current array item and the index of the item in the array. The
function must return 'true' to keep the item in the array,
false to remove it.</desc>
<params type='Array' name='array'>
<desc>要在其中查找项目的数组</desc>
</params>
<params type='Function' name='fn'>
<desc>处理数组项目的函数</desc>
</params>
<params type='Boolean' name='inv'>
<desc>反转选项 - 选择相反的筛选结果</desc>
</params>
<examples>
<code>$.grep( [0,1,2], function(i){
  return i &gt; 0;
});</code>
<result>[1, 2]</result>
</examples>
</method>
<method cat='JavaScript' type='Array' short='把一个数组中的项目转换到另一个数组中。' name='$.map'>
<cndesc>
把一个数组中的项目转换到另一个数组中。

作为参数的转换函数会被每个数组项目调用，而且会给这个转换函数传递一个表示要转换的项目的参数。

转换函数可以返回转换后的值、null（删除数组中的项目）或一个包含值的数组－－表示对原始数组项目的扩展模式。
</cndesc>
<desc>Translate all items in an array to another array of items.

The translation function that is provided to this method is
called for each item in the array and is passed one argument:
The item to be translated.

The function can then return the translated value, 'null'
(to remove the item), or  an array of values - which will
be flattened into the full array.</desc>
<params type='Array' name='array'>
<desc>要转换的数组</desc>
</params>
<params type='Function' name='fn'>
<desc>处理数组项目的函数</desc>
</params>
<examples>
<desc>把原始的数组映射到一个新数组中，并给新数组中的每个值都加上4。</desc>
<code>$.map( [0,1,2], function(i){
  return i + 4;
});</code>
<result>[4, 5, 6]</result>
</examples>
<examples>
<desc>把原始的数组映射到一个新数组中，如果新数组中的值大于0，就给这个值加上1；否则将这值删除。</desc>
<code>$.map( [0,1,2], function(i){
  return i &gt; 0 ? i + 1 : null;
});</code>
<result>[2, 3]</result>
</examples>
<examples>
<desc>把原始的数组映射到一个新数组中，将新数组中的每一个元素都扩展为两个，其中一个是其原始值，另一个是加上1之后的值。</desc>
<code>$.map( [0,1,2], function(i){
  return [ i, i + 1 ];
});</code>
<result>[0, 1, 1, 2, 2, 3]</result>
</examples>
</method>
<method property='1' cat='JavaScript' type='Boolean' short='包含从navigator对象中读取的用户代理标签（代理检测）。' name='$.browser'>
<cndesc>
包含从navigator.userAgent属性中读取的用户代理标签（代理检测）。
有效的标签有：safari, opera, msie, mozilla

这个属性在DOM载入完成之前就可以访问，所以可以使用它来针对某个浏览器添加ready事件。

有的时候，对象检测可能不太可靠，这时就有必要使用浏览器检测。只是为了避免同时使用两种手段！

把浏览器和对象检测结合使用，可以得到相当可靠的结果。
</cndesc>
<desc>Contains flags for the useragent, read from navigator.userAgent.
Available flags are: safari, opera, msie, mozilla

This property is available before the DOM is ready, therefore you can
use it to add ready events only for certain browsers.

There are situations where object detections is not reliable enough, in that
cases it makes sense to use browser detection. Simply try to avoid both!

A combination of browser and object detection yields quite reliable results.</desc>
<examples>
<desc>如果当前的用户代理是IE的某个版本就返回true。</desc>
<code>$.browser.msie</code>
</examples>
<examples>
<desc>只在safari浏览器中提示－"this is safari!"。</desc>
<code>if($.browser.safari) { $( function() { alert("this is safari!"); } ); }</code>
</examples>
</method>
</cat>
<cat value='Effects'>
<method cat='Effects' type='jQuery' short='显示隐藏的匹配元素。' name='show'>
<cndesc>
显示隐藏的匹配元素。
</cndesc>
<desc>Displays each of the set of matched elements if they are hidden.</desc>
<examples>
<code>$("p").show()</code>
<result>[ &lt;p style="display: block"&gt;Hello&lt;/p&gt; ]</result>
<before>&lt;p style="display: none"&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Effects' type='jQuery' short='隐藏显示的元素。' name='hide'>
<cndesc>
隐藏显示的元素。
</cndesc>
<desc>Hides each of the set of matched elements if they are shown.</desc>
<examples>
<code>$("p").hide()</code>
<result>[ &lt;p style="display: none"&gt;Hello&lt;/p&gt; ]</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Effects' type='jQuery' short='切换元素的可见状态。' name='toggle'>
<cndesc>
切换元素的可见状态。
如果元素是可见的，切换为隐藏的；如果元素是隐藏的，切换为可见的。
</cndesc>
<desc>Toggles each of the set of matched elements. If they are shown,
toggle makes them hidden. If they are hidden, toggle
makes them shown.</desc>
<examples>
<code>$("p").toggle()</code>
<result>[ &lt;p style="display: none"&gt;Hello&lt;/p&gt;, &lt;p style="display: block"&gt;Hello Again&lt;/p&gt; ]</result>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p style="display: none"&gt;Hello Again&lt;/p&gt;</before>
</examples>
</method>
<method cat='Effects' type='jQuery' see='hide(String|Number,Function)' short='以优雅的动画显示所有匹配的元素，并在显示完成后可选地触发一个回调函数。' name='show'>
<cndesc>
以优雅的动画显示所有匹配的元素，并在显示完成后可选地触发一个回调函数。

可以根据指定的速度动态地改变每个匹配元素的高度、宽度和不透明度。
</cndesc>
<desc>Show all matched elements using a graceful animation and firing an
optional callback after completion.

The height, width, and opacity of each of the matched elements
are changed dynamically according to the specified speed.</desc>
<params type='String|Number' name='speed'>
<desc>三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000)</desc>
</params>
<params type='Function' name='callback'>
<desc>(可选) 在动画完成时执行的函数</desc>
</params>
<examples>
<code>$("p").show("slow");</code>
</examples>
<examples>
<code>$("p").show("slow",function(){
  alert("Animation Done.");
});</code>
</examples>
</method>
<method cat='Effects' type='jQuery' see='show(String|Number,Function)' short='以优雅的动画隐藏所有匹配的元素，并在显示完成后可选地触发一个回调函数。' name='hide'>
<cndesc>
以优雅的动画隐藏所有匹配的元素，并在显示完成后可选地触发一个回调函数。

可以根据指定的速度动态地改变每个匹配元素的高度、宽度和不透明度。
</cndesc>
<desc>Hide all matched elements using a graceful animation and firing an
optional callback after completion.

The height, width, and opacity of each of the matched elements
are changed dynamically according to the specified speed.</desc>
<params type='String|Number' name='speed'>
<desc>三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000)</desc>
</params>
<params type='Function' name='callback'>
<desc>(可选) 在动画完成时执行的函数</desc>
</params>
<examples>
<code>$("p").hide("slow");</code>
</examples>
<examples>
<code>$("p").hide("slow",function(){
  alert("Animation Done.");
});</code>
</examples>
</method>
<method cat='Effects' type='jQuery' short='通过高度变化（向下增大）来动态地显示所有匹配的元素，在显示完成后可选地触发一个回调函数。' name='slideDown'>
<cndesc>
通过高度变化（向下增大）来动态地显示所有匹配的元素，在显示完成后可选地触发一个回调函数。

这个动画效果只调整元素的高度，可以使匹配的元素以“滑动”的方式显示出来。
</cndesc>
<desc>Reveal all matched elements by adjusting their height and firing an
optional callback after completion.

Only the height is adjusted for this animation, causing all matched
elements to be revealed in a "sliding" manner.</desc>
<see>slideUp(String|Number,Function)</see>
<see>slideToggle(String|Number,Function)</see>
<params type='String|Number' name='speed'>
<desc>(可选) 三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000)</desc>
</params>
<params type='Function' name='callback'>
<desc>(可选) 在动画完成时执行的函数</desc>
</params>
<examples>
<code>$("p").slideDown("slow");</code>
</examples>
<examples>
<code>$("p").slideDown("slow",function(){
  alert("Animation Done.");
});</code>
</examples>
</method>
<method cat='Effects' type='jQuery' short='通过高度变化（向上减小）来动态地隐藏所有匹配的元素，在隐藏完成后可选地触发一个回调函数。' name='slideUp'>
<cndesc>
通过高度变化（向上减小）来动态地隐藏所有匹配的元素，在隐藏完成后可选地触发一个回调函数。

这个动画效果只调整元素的高度，可以使匹配的元素以“滑动”的方式隐藏起来。
</cndesc>
<desc>Hide all matched elements by adjusting their height and firing an
optional callback after completion.

Only the height is adjusted for this animation, causing all matched
elements to be hidden in a "sliding" manner.</desc>
<see>slideDown(String|Number,Function)</see>
<see>slideToggle(String|Number,Function)</see>
<params type='String|Number' name='speed'>
<desc>(可选) 三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000)</desc>
</params>
<params type='Function' name='callback'>
<desc>(可选) 在动画完成时执行的函数</desc>
</params>
<examples>
<code>$("p").slideUp("slow");</code>
</examples>
<examples>
<code>$("p").slideUp("slow",function(){
  alert("Animation Done.");
});</code>
</examples>
</method>
<method cat='Effects' type='jQuery' short='通过高度变化来切换所有匹配元素的可见性，并在切换完成后可选地触发一个回调函数。' name='slideToggle'>
<cndesc>
通过高度变化来切换所有匹配元素的可见性，并在切换完成后可选地触发一个回调函数。

这个动画效果只调整元素的高度，可以使匹配的元素以“滑动”的方式隐藏或显示。
</cndesc>
<desc>Toggle the visibility of all matched elements by adjusting their height and firing an
optional callback after completion.

Only the height is adjusted for this animation, causing all matched
elements to be hidden in a "sliding" manner.</desc>
<see>slideDown(String|Number,Function)</see>
<see>slideUp(String|Number,Function)</see>
<params type='String|Number' name='speed'>
<desc>(可选) 三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000)</desc>
</params>
<params type='Function' name='callback'>
<desc>(可选) 在动画完成时执行的函数</desc>
</params>
<examples>
<code>$("p").slideToggle("slow");</code>
</examples>
<examples>
<code>$("p").slideToggle("slow",function(){
  alert("Animation Done.");
});</code>
</examples>
</method>
<method cat='Effects' type='jQuery' short='通过不透明度的变化来实现所有匹配元素的淡入效果，并在动画完成后可选地触发一个回调函数。' name='fadeIn'>
<cndesc>
通过不透明度的变化来实现所有匹配元素的淡入效果，并在动画完成后可选地触发一个回调函数。

这个动画只调整元素的不透明度，也就是说所有匹配的元素的高度和宽度不会发生变化。
</cndesc>
<desc>Fade in all matched elements by adjusting their opacity and firing an
optional callback after completion.

Only the opacity is adjusted for this animation, meaning that
all of the matched elements should already have some form of height
and width associated with them.</desc>
<see>fadeOut(String|Number,Function)</see>
<see>fadeTo(String|Number,Number,Function)</see>
<params type='String|Number' name='speed'>
<desc>(可选) 三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000)</desc>
</params>
<params type='Function' name='callback'>
<desc>(可选) 在动画完成时执行的函数</desc>
</params>
<examples>
<code>$("p").fadeIn("slow");</code>
</examples>
<examples>
<code>$("p").fadeIn("slow",function(){
  alert("Animation Done.");
});</code>
</examples>
</method>
<method cat='Effects' type='jQuery' short='通过不透明度的变化来实现所有匹配元素的淡出效果，并在动画完成后可选地触发一个回调函数。' name='fadeOut'>
<cndesc>
通过不透明度的变化来实现所有匹配元素的淡出效果，并在动画完成后可选地触发一个回调函数。

这个动画只调整元素的不透明度，也就是说所有匹配的元素的高度和宽度不会发生变化。
</cndesc>
<desc>Fade out all matched elements by adjusting their opacity and firing an
optional callback after completion.

Only the opacity is adjusted for this animation, meaning that
all of the matched elements should already have some form of height
and width associated with them.</desc>
<see>fadeIn(String|Number,Function)</see>
<see>fadeTo(String|Number,Number,Function)</see>
<params type='String|Number' name='speed'>
<desc>(可选) 三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000)</desc>
</params>
<params type='Function' name='callback'>
<desc>(可选) 在动画完成时执行的函数</desc>
</params>
<examples>
<code>$("p").fadeOut("slow");</code>
</examples>
<examples>
<code>$("p").fadeOut("slow",function(){
  alert("Animation Done.");
});</code>
</examples>
</method>
<method cat='Effects' type='jQuery' short='Fade the opacity of all matched elements to a specified opacity and firing an
optional callback after completion.' name='fadeTo'>
<cndesc>
把所有匹配元素的不透明度以渐进方式调整到指定的不透明度，并在动画完成后可选地触发一个回调函数。

这个动画只调整元素的不透明度，也就是说所有匹配的元素的高度和宽度不会发生变化。
</cndesc>
<desc>Fade the opacity of all matched elements to a specified opacity and firing an
optional callback after completion.

Only the opacity is adjusted for this animation, meaning that
all of the matched elements should already have some form of height
and width associated with them.</desc>
<see>fadeIn(String|Number,Function)</see>
<see>fadeOut(String|Number,Function)</see>
<params type='String|Number' name='speed'>
<desc>三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000)</desc>
</params>
<params type='Number' name='opacity'>
<desc>要调整到的不透明度值(0到1之间的数字).</desc>
</params>
<params type='Function' name='callback'>
<desc>(可选) 在动画完成时执行的函数</desc>
</params>
<examples>
<code>$("p").fadeTo("slow", 0.5);</code>
</examples>
<examples>
<code>$("p").fadeTo("slow", 0.5, function(){
  alert("Animation Done.");
});</code>
</examples>
</method>
<method cat='Effects' type='jQuery' short='用于创建自定义动画的函数。' name='animate'>
<cndesc>
用于创建自定义动画的函数。
这个函数的关键在于指定动画形式及结果样式属性对象。这个对象中每个属性都表示一个可以变化的样式属性（如“height”、“top”或“opacity”）。

而每个属性的值表示这个样式属性到多少时动画结果。如果是一个数值，样式属性就会从当前的值渐变到指定的值。
如果使用的是“hide”、“show”或“toggle”这样的字符串值，则会为该属性调用默认的动画形式。
</cndesc>
<desc>A function for making your own, custom, animations. The key aspect of
this function is the object of style properties that will be animated,
and to what end. Each key within the object represents a style property
that will also be animated (for example: "height", "top", or "opacity").

The value associated with the key represents to what end the property
will be animated. If a number is provided as the value, then the style
property will be transitioned from its current state to that new number.
Oterwise if the string "hide", "show", or "toggle" is provided, a default
animation will be constructed for that property.</desc>
<params type='Hash' name='params'>
<desc>一组包含作为动画属性和终值的样式属性和及其值的集合</desc>
</params>
<params type='String|Number' name='speed'>
<desc>(可选) 三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000)</desc>
</params>
<params type='String' name='easing'>
<desc>(可选) 要使用的擦除效果的名称(需要插件支持).</desc>
</params>
<params type='Function' name='callback'>
<desc>(可选) 在动画完成时执行的函数</desc>
</params>
<examples>
<code>$("p").animate({
  height: 'toggle', opacity: 'toggle'
}, "slow");</code>
</examples>
<examples>
<code>$("p").animate({
  left: 50, opacity: 'show'
}, 500);</code>
</examples>
<examples>
<desc>An example of using an 'easing' function to provide a different style of animation. This will only work if you have a plugin that provides this easing function (Only 'linear' is provided by default, with jQuery).</desc>
<code>$("p").animate({
  opacity: 'show'
}, "slow", "easein");</code>
</examples>
</method>
</cat>
<cat value='Events'>
<method cat='Events' type='jQuery' short='为每一个匹配元素的特定事件（像click）绑定一个事件处理器函数。' name='bind'>
<cndesc>
为每一个匹配元素的特定事件（像click）绑定一个事件处理器函数。
这个事件处理函数会接收到一个事件对象，可以通过它来阻止（浏览器）默认的行为。
如果既想取消默认的行为，又想阻止事件起泡，这个事件处理函数必须返回false。

多数情况下，可以把事件处理器函数定义为匿名函数（见示例一）。
在不可能定义匿名函数的情况下，可以传递一个可选的数据对象作为第二个参数（而事件处理器函数则作为第三个参数），
见示例二。
</cndesc>
<desc>Binds a handler to a particular event (like click) for each matched element.
The event handler is passed an event object that you can use to prevent
default behaviour. To stop both default action and event bubbling, your handler
has to return false.

In most cases, you can define your event handlers as anonymous functions
(see first example). In cases where that is not possible, you can pass additional
data as the second paramter (and the handler function as the third), see
second example.</desc>
<params type='String' name='type'>
<desc>事件类型</desc>
</params>
<params type='Object' name='data'>
<desc>(可选) 作为event.data属性值传递给事件对象的额外数据对象</desc>
</params>
<params type='Function' name='fn'>
<desc>绑定到每个匹配元素的事件上面的处理函数</desc>
</params>
<examples>
<code>
$("p").bind("click", function(){
  alert( $(this).text() );
});</code>
<result>alert("Hello")</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
<examples>
<desc>为事件对象传递一些额外的数据。</desc>
<code>
function handler(event) {
  alert(event.data.foo);
}
$("p").bind("click", {foo: "bar"}, handler)</code>
<result>alert("bar")</result>
</examples>
<examples>
<desc>通过返回false来取消默认的行为并阻止事件起泡。</desc>
<code>$("form").bind("submit", function() { return false; })</code>
</examples>
<examples>
<desc>通过使用 preventDefault 方法只取消默认的行为。</desc>
<code>$("form").bind("submit", function(event){
  event.preventDefault();
});</code>
</examples>
<examples>
<desc>通过使用 stopPropagation 方法只阻止事件起泡。</desc>
<code>$("form").bind("submit", function(event){
  event.stopPropagation();
});</code>
</examples>
</method>
<method cat='Events' type='jQuery' short='为每一个匹配元素的特定事件（像click）绑定一个事件处理器函数（只执行一次）。' name='one'>
<cndesc>
为每一个匹配元素的特定事件（像click）绑定一个事件处理器函数。
在每个对象上，这个事件处理函数只会被执行一次。其他规则与bind()函数相同。
这个事件处理函数会接收到一个事件对象，可以通过它来阻止（浏览器）默认的行为。
如果既想取消默认的行为，又想阻止事件起泡，这个事件处理函数必须返回false。

多数情况下，可以把事件处理器函数定义为匿名函数（见示例一）。
在不可能定义匿名函数的情况下，可以传递一个可选的数据对象作为第二个参数（而事件处理器函数则作为第三个参数），
见示例二。
</cndesc>
<desc>Binds a handler to a particular event (like click) for each matched element.
The handler is executed only once for each element. Otherwise, the same rules
as described in bind() apply.
	 The event handler is passed an event object that you can use to prevent
default behaviour. To stop both default action and event bubbling, your handler
has to return false.

In most cases, you can define your event handlers as anonymous functions
(see first example). In cases where that is not possible, you can pass additional
data as the second paramter (and the handler function as the third), see
second example.</desc>
<params type='String' name='type'>
<desc>事件类型</desc>
</params>
<params type='Object' name='data'>
<desc>(可选) 作为event.data属性值传递给事件对象的额外数据对象</desc>
</params>
<params type='Function' name='fn'>
<desc>绑定到每个匹配元素的事件上面的处理函数</desc>
</params>
<examples>
<code>$("p").one("click", function(){
  alert( $(this).text() );
});</code>
<result>alert("Hello")</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='反绑定，从每一个匹配的元素中删除绑定的事件。' name='unbind'>
<cndesc>
反绑定，从每一个匹配的元素中删除绑定的事件。

如果没有参数，则删除所有绑定的事件。

如果提供了事件类型作为参数，则只删除该类型的绑定事件。

如果把在绑定时传递的处理函数作为第二个参数，则只有这个特定的事件处理函数会被删除。
</cndesc>
<desc>The opposite of bind, removes a bound event from each of the matched
elements.

Without any arguments, all bound events are removed.

If the type is provided, all bound events of that type are removed.

If the function that was passed to bind is provided as the second argument,
only that specific event handler is removed.</desc>
<params type='String' name='type'>
<desc>(可选) 事件类型</desc>
</params>
<params type='Function' name='fn'>
<desc>(可选) 要从每个匹配元素的事件中反绑定的事件处理函数</desc>
</params>
<examples>
<code>$("p").unbind()</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
<before>&lt;p onclick="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
</examples>
<examples>
<code>$("p").unbind( "click" )</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
<before>&lt;p onclick="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
</examples>
<examples>
<code>$("p").unbind( "click", function() { alert("Hello"); } )</code>
<result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
<before>&lt;p onclick="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配的元素上触发某类事件。' name='trigger'>
<cndesc>
在每一个匹配的元素上触发某类事件。
</cndesc>
<desc>Trigger a type of event on every matched element.</desc>
<params type='String' name='type'>
<desc>要触发的事件类型</desc>
</params>
<examples>
<code>$("p").trigger("click")</code>
<result>alert('hello')</result>
<before>&lt;p click="alert('hello')"&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='每次点击时切换要调用的函数。e'>
<cndesc>
每次点击时切换要调用的函数。
如果点击了一个匹配的元素，则触发指定的第一个函数，当再次点击同一元素时，则触发指定的第二个函数。
随后的每次点击都重复对这两个函数的轮番调用。

可以使用unbind("click")来删除。
</cndesc>
<desc>Toggle between two function calls every other click.
Whenever a matched element is clicked, the first specified function
is fired, when clicked again, the second is fired. All subsequent
clicks continue to rotate through the two functions.

Use unbind("click") to remove.</desc>
<params type='Function' name='even'>
<desc>第奇数次点击时要执行的函数。</desc>
</params>
<params type='Function' name='odd'>
<desc>第偶数次点击时要执行的函数。</desc>
</params>
<examples>
<code>$("p").toggle(function(){
  $(this).addClass("selected");
},function(){
  $(this).removeClass("selected");
});</code>
</examples>
</method>
<method cat='Events' type='jQuery' short='一个模仿悬停事件（鼠标移动到一个对象上面，及移出这个对象）的方法.' name='hover'>
<cndesc>
一个模仿悬停事件（鼠标移动到一个对象上面，及移出这个对象）的方法。
这是一个自定义的方法，它为频繁使用的任务提供了一种“保持在其中”的状态。

当鼠标移动到一个匹配的元素上面时，会触发指定的第一个函数。
当鼠标移出这个元素时，会触发指定的第二个函数。
而且，会伴随着对鼠标是否仍然处在特定元素中的检测（例如，处在div中的图像），
如果是，则会继续保持“悬念”状态，而不触发移出事件（修正了使用mouseout事件的一个常见错误）。
</cndesc>
<desc>A method for simulating hovering (moving the mouse on, and off,
an object). This is a custom method which provides an 'in' to a
frequent task.

Whenever the mouse cursor is moved over a matched
element, the first specified function is fired. Whenever the mouse
moves off of the element, the second specified function fires.
Additionally, checks are in place to see if the mouse is still within
the specified element itself (for example, an image inside of a div),
and if it is, it will continue to 'hover', and not move out
(a common error in using a mouseout event handler).</desc>
<params type='Function' name='over'>
<desc>鼠标移到元素上要触发的函数</desc>
</params>
<params type='Function' name='out'>
<desc>鼠标移出元素要触发的函数</desc>
</params>
<examples>
<code>$("p").hover(function(){
  $(this).addClass("over");
},function(){
  $(this).addClass("out");
});</code>
</examples>
</method>
<method cat='Events' type='jQuery' short='当DOM载入就绪可以查询及操纵时绑定一个要执行的函数。' name='ready'>
<cndesc>
当DOM载入就绪可以查询及操纵时绑定一个要执行的函数。
这是事件模块中最重要的一个函数，因为它可以极大地提高web应用程序的响应速度。

简单地说，这个方法纯粹是对向window.load事件注册事件的替代方法。
通过使用这个方法，可以在DOM载入就绪能够读取并操纵时立即调用你所绑定的函数，
而99.99%的JavaScript函数都需要在那一刻执行。

请确保在&lt;body&gt;元素的onload事件中没有注册函数，否则不会触发$(document).ready()事件。

可以在同一个页面中无限次地使用$(document).ready()事件。其中注册的函数会按照（代码中的）先后顺序依次执行。
</cndesc>
<desc>Bind a function to be executed whenever the DOM is ready to be
traversed and manipulated. This is probably the most important
function included in the event module, as it can greatly improve
the response times of your web applications.

In a nutshell, this is a solid replacement for using window.onload,
and attaching a function to that. By using this method, your bound Function
will be called the instant the DOM is ready to be read and manipulated,
which is exactly what 99.99% of all Javascript code needs to run.

Please ensure you have no code in your &lt;body&gt; onload event handler,
otherwise $(document).ready() may not fire.

You can have as many $(document).ready events on your page as you like.
The functions are then executed in the order they were added.</desc>
<params type='Function' name='fn'>
<desc>要在DOM就绪时执行的函数</desc>
</params>
<examples>
<code>$(document).ready(function(){ Your code here... });</code>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的scroll事件中绑定一个处理函数。' name='scroll'>
<cndesc>
在每一个匹配元素的scroll事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the scroll event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的scoll事件中绑定的处理函数</desc>
</params>
<examples>
<code>$("p").scroll( function() { alert("Hello"); } );</code>
<result>&lt;p onscroll="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的submit事件中绑定一个处理函数。' name='submit'>
<cndesc>
<cndesc>
在每一个匹配元素的submit事件中绑定一个处理函数。
</cndesc>
</cndesc>
<desc>Bind a function to the submit event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的submit事件中绑定的处理函数</desc>
</params>
<examples>
<desc>Prevents the form submission when the input has no value entered.</desc>
<code>$("#myform").submit( function() {
  return $("input", this).val().length &gt; 0;
} );</code>
<before>&lt;form id="myform"&gt;&lt;input /&gt;&lt;/form&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='触发每一个匹配元素的submit事件。' name='submit'>
<cndesc>
触发每一个匹配元素的submit事件。这个函数会调用执行绑定到submit事件的所有函数。

注意：这个函数不会调用form元素的submit方法！如果需要通过代码来提交表单，必须使用DOM方法，
例如：$("form")[0].submit();
</cndesc>
<desc>Trigger the submit event of each matched element. This causes all of the functions
that have been bound to thet submit event to be executed.

Note: This does not execute the submit method of the form element! If you need to
submit the form via code, you have to use the DOM method, eg. $("form")[0].submit();</desc>
<examples>
<desc>触发注册到表单的所有submit事件，但不提交表单。</desc>
<code>$("form").submit();</code>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的focus事件中绑定一个处理函数。' name='focus'>
<cndesc>
在每一个匹配元素的focus事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the focus event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的submit事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").focus( function() { alert("Hello"); } );</code>
<result>&lt;p onfocus="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='触发每一个匹配元素的focus事件。' name='focus'>
<cndesc>
触发每一个匹配元素的focus事件。这个函数会调用执行绑定到focus事件的所有函数。

注意：这个函数不会调用相应元素的focus方法！如果需要通过代码来使一个元素获得焦点，必须使用DOM方法，
例如：$("#myinput")[0].focus();
</cndesc>
<desc>Trigger the focus event of each matched element. This causes all of the functions
that have been bound to thet focus event to be executed.

Note: This does not execute the focus method of the underlying elements! If you need to
focus an element via code, you have to use the DOM method, eg. $("#myinput")[0].focus();</desc>
<examples>
<code>$("p").focus();</code>
<result>alert('Hello');</result>
<before>&lt;p onfocus="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的keydown事件中绑定一个处理函数。' name='keydown'>
<cndesc>
在每一个匹配元素的keydown事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the keydown event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的keydown事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").keydown( function() { alert("Hello"); } );</code>
<result>&lt;p onkeydown="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的dblclick事件中绑定一个处理函数。' name='dblclick'>
<cndesc>
在每一个匹配元素的dblclick事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the dblclick event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的dblclick事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").dblclick( function() { alert("Hello"); } );</code>
<result>&lt;p ondblclick="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的keypress事件中绑定一个处理函数。' name='keypress'>
<cndesc>
在每一个匹配元素的keypress事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the keypress event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的keypress事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").keypress( function() { alert("Hello"); } );</code>
<result>&lt;p onkeypress="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的error事件中绑定一个处理函数。' name='error'>
<cndesc>
在每一个匹配元素的error事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the error event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的error事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").error( function() { alert("Hello"); } );</code>
<result>&lt;p onerror="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的blur事件中绑定一个处理函数。' name='blur'>
<cndesc>
在每一个匹配元素的blur事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the blur event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的blur事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").blur( function() { alert("Hello"); } );</code>
<result>&lt;p onblur="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='触发每一个匹配元素的blur事件。' name='blur'>
<cndesc>
触发每一个匹配元素的blur事件。这个函数会调用执行绑定到blur事件的所有函数。

注意：这个函数不会调用相应元素的blur方法！如果需要通过代码来使一个元素获得焦点，必须使用DOM方法，
例如：$("#myinput")[0].blur();
</cndesc>
<desc>Trigger the blur event of each matched element. This causes all of the functions
that have been bound to thet blur event to be executed.

Note: This does not execute the blur method of the underlying elements! If you need to
blur an element via code, you have to use the DOM method, eg. $("#myinput")[0].blur();</desc>
<examples>
<code>$("p").blur();</code>
<result>alert('Hello');</result>
<before>&lt;p onblur="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的load事件中绑定一个处理函数。' name='load'>
<cndesc>
在每一个匹配元素的load事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the load event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的load事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").load( function() { alert("Hello"); } );</code>
<result>&lt;p onload="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的select事件中绑定一个处理函数。' name='select'>
<cndesc>
在每一个匹配元素的select事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the select event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的select事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").select( function() { alert("Hello"); } );</code>
<result>&lt;p onselect="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='触发每一个匹配元素的select事件。' name='select'>
<cndesc>
触发每一个匹配元素的select事件。这个函数会调用执行绑定到select事件的所有函数。
</cndesc>
<desc>Trigger the select event of each matched element. This causes all of the functions
that have been bound to thet select event to be executed.</desc>
<examples>
<code>$("p").select();</code>
<result>alert('Hello');</result>
<before>&lt;p onselect="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的mouseup事件中绑定一个处理函数。' name='mouseup'>
<cndesc>
在每一个匹配元素的mouseup事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the mouseup event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的mouseup事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").mouseup( function() { alert("Hello"); } );</code>
<result>&lt;p onmouseup="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的unload事件中绑定一个处理函数。' name='unload'>
<cndesc>
在每一个匹配元素的unload事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the unload event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的unload事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").unload( function() { alert("Hello"); } );</code>
<result>&lt;p onunload="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的change事件中绑定一个处理函数。' name='change'>
<cndesc>
在每一个匹配元素的change事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the change event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的change事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").change( function() { alert("Hello"); } );</code>
<result>&lt;p onchange="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的mouseout事件中绑定一个处理函数。' name='mouseout'>
<cndesc>
在每一个匹配元素的mouseout事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the mouseout event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的mouseout事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").mouseout( function() { alert("Hello"); } );</code>
<result>&lt;p onmouseout="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的keyup事件中绑定一个处理函数。' name='keyup'>
<cndesc>
在每一个匹配元素的keyup事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the keyup event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的keyup事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").keyup( function() { alert("Hello"); } );</code>
<result>&lt;p onkeyup="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的click事件中绑定一个处理函数。' name='click'>
<cndesc>
在每一个匹配元素的click事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the click event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的click事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").click( function() { alert("Hello"); } );</code>
<result>&lt;p onclick="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='触发每一个匹配元素的click事件。这个函数会调用执行绑定到click事件的所有函数。' name='click'>
<cndesc>
触发每一个匹配元素的click事件。这个函数会调用执行绑定到click事件的所有函数。
</cndesc>
<desc>Trigger the click event of each matched element. This causes all of the functions
that have been bound to thet click event to be executed.</desc>
<examples>
<code>$("p").click();</code>
<result>alert('Hello');</result>
<before>&lt;p onclick="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的resize事件中绑定一个处理函数。' name='resize'>
<cndesc>
在每一个匹配元素的resize事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the resize event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的resize事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").resize( function() { alert("Hello"); } );</code>
<result>&lt;p onresize="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的mousemove事件中绑定一个处理函数。' name='mousemove'>
<cndesc>
在每一个匹配元素的mousemove事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the mousemove event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的mousemove事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").mousemove( function() { alert("Hello"); } );</code>
<result>&lt;p onmousemove="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的mousedown事件中绑定一个处理函数。' name='mousedown'>
<cndesc>
在每一个匹配元素的mousedown事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the mousedown event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的mousedown事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").mousedown( function() { alert("Hello"); } );</code>
<result>&lt;p onmousedown="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
<method cat='Events' type='jQuery' short='在每一个匹配元素的mouseover事件中绑定一个处理函数。' name='mouseover'>
<cndesc>
在每一个匹配元素的mouseover事件中绑定一个处理函数。
</cndesc>
<desc>Bind a function to the mouseover event of each matched element.</desc>
<params type='Function' name='fn'>
<desc>在每一个匹配元素的mouseover事件中绑定的处理函数。</desc>
</params>
<examples>
<code>$("p").mouseover( function() { alert("Hello"); } );</code>
<result>&lt;p onmouseover="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
<before>&lt;p&gt;Hello&lt;/p&gt;</before>
</examples>
</method>
</cat>
<cat value='Ajax'>
<method cat='Ajax' type='jQuery' short='Load HTML from a remote file and inject it into the DOM, only if it&apos;s
been modified by the server.' name='loadIfModified'>
<cndesc>

</cndesc>
<desc>Load HTML from a remote file and inject it into the DOM, only if it's
been modified by the server.</desc>
<params type='String' name='url'>
<desc>The URL of the HTML file to load.</desc>
</params>
<params type='Map' name='params'>
<desc>(optional) Key/value pairs that will be sent to the server.</desc>
</params>
<params type='Function' name='callback'>
<desc>(optional) A function to be executed whenever the data is loaded (parameters: responseText, status and response itself).</desc>
</params>
<examples>
<code>$("#feeds").loadIfModified("feeds.html");</code>
<result>&lt;div id="feeds"&gt;&lt;b&gt;45&lt;/b&gt; feeds found.&lt;/div&gt;</result>
<before>&lt;div id="feeds"&gt;&lt;/div&gt;</before>
</examples>
</method>
<method cat='Ajax' type='jQuery' short='Load HTML from a remote file and inject it into the DOM.' name='load'>
<desc>Load HTML from a remote file and inject it into the DOM.

Note: Avoid to use this to load scripts, instead use $.getScript.
IE strips script tags when there aren't any other characters in front of it.</desc>
<params type='String' name='url'>
<desc>The URL of the HTML file to load.</desc>
</params>
<params type='Object' name='params'>
<desc>(optional) A set of key/value pairs that will be sent as data to the server.</desc>
</params>
<params type='Function' name='callback'>
<desc>(optional) A function to be executed whenever the data is loaded (parameters: responseText, status and response itself).</desc>
</params>
<examples>
<code>$("#feeds").load("feeds.html");</code>
<result>&lt;div id="feeds"&gt;&lt;b&gt;45&lt;/b&gt; feeds found.&lt;/div&gt;</result>
<before>&lt;div id="feeds"&gt;&lt;/div&gt;</before>
</examples>
<examples>
<desc>Same as above, but with an additional parameter
and a callback that is executed when the data was loaded.</desc>
<code>$("#feeds").load("feeds.html",
  {limit: 25},
  function() { alert("The last 25 entries in the feed have been loaded"); }
);</code>
</examples>
</method>
<method cat='Ajax' type='String' short='Serializes a set of input elements into a string of data.' name='serialize'>
<desc>Serializes a set of input elements into a string of data.
This will serialize all given elements.

A serialization similar to the form submit of a browser is
provided by the form plugin. It also takes multiple-selects
into account, while this method recognizes only a single option.</desc>
<examples after='name=John&amp;location=Boston'>
<desc>Serialize a selection of input elements to a string</desc>
<before>&lt;input type='text' name='name' value='John'/&gt;
&lt;input type='text' name='location' value='Boston'/&gt;</before>
<code>$("input[@type=text]").serialize();</code>
</examples>
</method>
<method cat='Ajax' type='jQuery' short='Evaluate all script tags inside this jQuery.' private='1' name='evalScripts'>
<desc>Evaluate all script tags inside this jQuery. If they have a src attribute,
the script is loaded, otherwise it's content is evaluated.</desc>
</method>
<method cat='Ajax' type='jQuery' short='Attach a function to be executed whenever an AJAX request begins
and there is none already active.' name='ajaxStart'>
<desc>Attach a function to be executed whenever an AJAX request begins
and there is none already active.</desc>
<params type='Function' name='callback'>
<desc>The function to execute.</desc>
</params>
<examples>
<desc>Show a loading message whenever an AJAX request starts
(and none is already active).</desc>
<code>$("#loading").ajaxStart(function(){
  $(this).show();
});</code>
</examples>
</method>
<method cat='Ajax' type='jQuery' short='Attach a function to be executed whenever all AJAX requests have ended.' name='ajaxStop'>
<desc>Attach a function to be executed whenever all AJAX requests have ended.</desc>
<params type='Function' name='callback'>
<desc>The function to execute.</desc>
</params>
<examples>
<desc>Hide a loading message after all the AJAX requests have stopped.</desc>
<code>$("#loading").ajaxStop(function(){
  $(this).hide();
});</code>
</examples>
</method>
<method cat='Ajax' type='jQuery' short='Attach a function to be executed whenever an AJAX request completes.' name='ajaxComplete'>
<desc>Attach a function to be executed whenever an AJAX request completes.

The XMLHttpRequest and settings used for that request are passed
as arguments to the callback.</desc>
<params type='Function' name='callback'>
<desc>The function to execute.</desc>
</params>
<examples>
<desc>Show a message when an AJAX request completes.</desc>
<code>$("#msg").ajaxComplete(function(request, settings){
  $(this).append("&lt;li&gt;Request Complete.&lt;/li&gt;");
});</code>
</examples>
</method>
<method cat='Ajax' type='jQuery' short='Attach a function to be executed whenever an AJAX request completes
successfully.' name='ajaxSuccess'>
<desc>Attach a function to be executed whenever an AJAX request completes
successfully.

The XMLHttpRequest and settings used for that request are passed
as arguments to the callback.</desc>
<params type='Function' name='callback'>
<desc>The function to execute.</desc>
</params>
<examples>
<desc>Show a message when an AJAX request completes successfully.</desc>
<code>$("#msg").ajaxSuccess(function(request, settings){
  $(this).append("&lt;li&gt;Successful Request!&lt;/li&gt;");
});</code>
</examples>
</method>
<method cat='Ajax' type='jQuery' short='Attach a function to be executed whenever an AJAX request fails.' name='ajaxError'>
<desc>Attach a function to be executed whenever an AJAX request fails.

The XMLHttpRequest and settings used for that request are passed
as arguments to the callback. A third argument, an exception object,
is passed if an exception occured while processing the request.</desc>
<params type='Function' name='callback'>
<desc>The function to execute.</desc>
</params>
<examples>
<desc>Show a message when an AJAX request fails.</desc>
<code>$("#msg").ajaxError(function(request, settings){
  $(this).append("&lt;li&gt;Error requesting page " + settings.url + "&lt;/li&gt;");
});</code>
</examples>
</method>
<method cat='Ajax' type='jQuery' short='Attach a function to be executed before an AJAX request is send.' name='ajaxSend'>
<desc>Attach a function to be executed before an AJAX request is send.

The XMLHttpRequest and settings used for that request are passed
as arguments to the callback.</desc>
<params type='Function' name='callback'>
<desc>The function to execute.</desc>
</params>
<examples>
<desc>Show a message before an AJAX request is send.</desc>
<code>$("#msg").ajaxSend(function(request, settings){
  $(this).append("&lt;li&gt;Starting request at " + settings.url + "&lt;/li&gt;");
});</code>
</examples>
</method>
<method cat='Ajax' type='XMLHttpRequest' short='Load a remote page using an HTTP GET request.' name='$.get'>
<desc>Load a remote page using an HTTP GET request.</desc>
<params type='String' name='url'>
<desc>The URL of the page to load.</desc>
</params>
<params type='Map' name='params'>
<desc>(optional) Key/value pairs that will be sent to the server.</desc>
</params>
<params type='Function' name='callback'>
<desc>(optional) A function to be executed whenever the data is loaded.</desc>
</params>
<examples>
<code>$.get("test.cgi");</code>
</examples>
<examples>
<code>$.get("test.cgi", { name: "John", time: "2pm" } );</code>
</examples>
<examples>
<code>$.get("test.cgi", function(data){
  alert("Data Loaded: " + data);
});</code>
</examples>
<examples>
<code>$.get("test.cgi",
  { name: "John", time: "2pm" },
  function(data){
    alert("Data Loaded: " + data);
  }
);</code>
</examples>
</method>
<method cat='Ajax' type='XMLHttpRequest' short='Load a remote page using an HTTP GET request, only if it hasn&apos;t
been modified since it was last retrieved.' name='$.getIfModified'>
<desc>Load a remote page using an HTTP GET request, only if it hasn't
been modified since it was last retrieved.</desc>
<params type='String' name='url'>
<desc>The URL of the page to load.</desc>
</params>
<params type='Map' name='params'>
<desc>(optional) Key/value pairs that will be sent to the server.</desc>
</params>
<params type='Function' name='callback'>
<desc>(optional) A function to be executed whenever the data is loaded.</desc>
</params>
<examples>
<code>$.getIfModified("test.html");</code>
</examples>
<examples>
<code>$.getIfModified("test.html", { name: "John", time: "2pm" } );</code>
</examples>
<examples>
<code>$.getIfModified("test.cgi", function(data){
  alert("Data Loaded: " + data);
});</code>
</examples>
<examples>
<code>$.getifModified("test.cgi",
  { name: "John", time: "2pm" },
  function(data){
    alert("Data Loaded: " + data);
  }
);</code>
</examples>
</method>
<method cat='Ajax' type='XMLHttpRequest' short='Loads, and executes, a remote JavaScript file using an HTTP GET request.' name='$.getScript'>
<desc>Loads, and executes, a remote JavaScript file using an HTTP GET request.

Warning: Safari &lt;= 2.0.x is unable to evalulate scripts in a global
context synchronously. If you load functions via getScript, make sure
to call them after a delay.</desc>
<params type='String' name='url'>
<desc>The URL of the page to load.</desc>
</params>
<params type='Function' name='callback'>
<desc>(optional) A function to be executed whenever the data is loaded.</desc>
</params>
<examples>
<code>$.getScript("test.js");</code>
</examples>
<examples>
<code>$.getScript("test.js", function(){
  alert("Script loaded and executed.");
});</code>
</examples>
</method>
<method cat='Ajax' type='XMLHttpRequest' short='Load JSON data using an HTTP GET request.' name='$.getJSON'>
<desc>Load JSON data using an HTTP GET request.</desc>
<params type='String' name='url'>
<desc>The URL of the page to load.</desc>
</params>
<params type='Map' name='params'>
<desc>(optional) Key/value pairs that will be sent to the server.</desc>
</params>
<params type='Function' name='callback'>
<desc>A function to be executed whenever the data is loaded.</desc>
</params>
<examples>
<code>$.getJSON("test.js", function(json){
  alert("JSON Data: " + json.users[3].name);
});</code>
</examples>
<examples>
<code>$.getJSON("test.js",
  { name: "John", time: "2pm" },
  function(json){
    alert("JSON Data: " + json.users[3].name);
  }
);</code>
</examples>
</method>
<method cat='Ajax' type='XMLHttpRequest' short='Load a remote page using an HTTP POST request.' name='$.post'>
<desc>Load a remote page using an HTTP POST request.</desc>
<params type='String' name='url'>
<desc>The URL of the page to load.</desc>
</params>
<params type='Map' name='params'>
<desc>(optional) Key/value pairs that will be sent to the server.</desc>
</params>
<params type='Function' name='callback'>
<desc>(optional) A function to be executed whenever the data is loaded.</desc>
</params>
<examples>
<code>$.post("test.cgi");</code>
</examples>
<examples>
<code>$.post("test.cgi", { name: "John", time: "2pm" } );</code>
</examples>
<examples>
<code>$.post("test.cgi", function(data){
  alert("Data Loaded: " + data);
});</code>
</examples>
<examples>
<code>$.post("test.cgi",
  { name: "John", time: "2pm" },
  function(data){
    alert("Data Loaded: " + data);
  }
);</code>
</examples>
</method>
<method cat='Ajax' type='undefined' short='Set the timeout of all AJAX requests to a specific amount of time.' name='$.ajaxTimeout'>
<desc>Set the timeout of all AJAX requests to a specific amount of time.
This will make all future AJAX requests timeout after a specified amount
of time.

Set to null or 0 to disable timeouts (default).

You can manually abort requests with the XMLHttpRequest's (returned by
all ajax functions) abort() method.

Deprecated. Use $.ajaxSetup instead.</desc>
<params type='Number' name='time'>
<desc>How long before an AJAX request times out.</desc>
</params>
<examples>
<desc>Make 