{"id":5084,"date":"2016-06-13T16:09:39","date_gmt":"2016-06-13T08:09:39","guid":{"rendered":"https:\/\/sdeno.com\/?p=5084"},"modified":"2016-06-13T17:00:46","modified_gmt":"2016-06-13T09:00:46","slug":"phpquery-php%e6%89%8b%e5%86%8c","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=5084","title":{"rendered":"phpquery.php\u624b\u518c"},"content":{"rendered":"<p>phpquery.php\u7684\u597d\u5904\u53ef\u4ee5\u8ddfjquery\u4e00\u6837\u53bb\u64cd\u4f5cDOM\uff0c\u5bf9\u8c61\u548c\u6570\u7ec4\uff0c\u514d\u53bb\u4e86\u5b66\u4e60\u65b0\u7684API\u3002<\/p>\n<p>\u5728\u4f7f\u7528phpquery.php\u4e4b\u524d\u8981\u52a0\u8f7d\u5982\uff1a<\/p>\n<pre>include 'phpQuery\/phpQuery.php';<\/pre>\n<pre>\u83b7\u53d6\u5143\u7d20\r\npq('div') \u76f8\u5f53\u4e8ejquery\u7684  $('div')<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u57fa\u7840\u77e5\u8bc6\/Basics<\/span><\/p>\n<p>\u52a0\u8f7d\u6587\u6863\uff0c\u6839\u636e\u6587\u6863\u7684\u7c7b\u578b\u4e0d\u540c\u52a0\u8f7d\u4e0d\u540c\u7684\u6587\u6863<\/p>\n<pre>\/\/\u7b80\u5355\u6848\u4f8b\r\nphpQuery::newDocumentFileXHTML('my-xhtml.html')-&gt;find('p');\r\n\r\nphpQuery::newDocumentFileXHTML('test.html'); \/\/\u83b7\u53d6html\u6587\u6863\u5185\u5bb9\r\nphpQuery::newDocumentFilePHP('test.php');  \/\/\u83b7\u53d6php\u6587\u6863\u5185\u5bb9\r\nphpQuery::newDocument('test.xml', 'application\/rss+xml');  \/\/\u9ed8\u8ba4\u662futf8\u5982\u679c\u4e0d\u9700\u8981\uff0c\u8981\u81ea\u5df1\u624b\u52a8\u4fee\u6539\r\nphpQuery::newDocument('&lt;div\/&gt;'); \/\/\u521b\u5efa\u65b0\u5143\u7d20<\/pre>\n<p>phpQuery::newDocument($html, $contentType = null) Creates new document from markup. If no $contentType, autodetection is made (based on markup). If it fails, text\/html in utf-8 is used.<br \/>\nphpQuery::newDocumentFile($file, $contentType = null) Creates new document from file. Works like newDocument()<br \/>\nphpQuery::newDocumentHTML($html, $charset = &#8216;utf-8&#8217;)<br \/>\nphpQuery::newDocumentXHTML($html, $charset = &#8216;utf-8&#8217;)<br \/>\nphpQuery::newDocumentXML($html, $charset = &#8216;utf-8&#8217;)<br \/>\nphpQuery::newDocumentPHP($html, $contentType = null) Read more about it on PHPSupport page<br \/>\nphpQuery::newDocumentFileHTML($file, $charset = &#8216;utf-8&#8217;)<br \/>\nphpQuery::newDocumentFileXHTML($file, $charset = &#8216;utf-8&#8217;)<br \/>\nphpQuery::newDocumentFileXML($file, $charset = &#8216;utf-8&#8217;)<br \/>\nphpQuery::newDocumentFilePHP($file, $contentType) Read more about it on PHPSupport page<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u00a0\u9009\u62e9\u5668\/Selectors<\/span><\/p>\n<pre>\/\/\u9009\u62e9\u5668\u7684\u4f7f\u7528\u65b9\u6cd5\u8ddfjquery\u5dee\u4e0d\u591a\uff0c\u53ea\u662f\u4f7f\u7528\u94fe\u5f0f\u5199\u6cd5\u4e0d\u662f\u7528\u70b9\u53bb\u8fde\u63a5\u800c\u662f\u7528-&gt;\r\npq(\".class ul &gt; li[rel='foo']:first:has(a)\")-&gt;appendTo('.append-target-wrapper div')-&gt;...<\/pre>\n<ul style=\"color: #444444;\">\n<li>\n<h2 style=\"font-weight: bold;\">Basics<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/id\">#id<\/a><\/strong>\u00a0Matches a single element with the given id attribute.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/element\">element<\/a><\/strong>\u00a0Matches all elements with the given name.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/class\">.class<\/a><\/strong>\u00a0Matches all elements with the given class.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/all\">*<\/a><\/strong>\u00a0Matches all elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/multiple\">selector1, selector2, selectorN<\/a><\/strong>\u00a0Matches the combined results of all the specified selectors.<br \/>\n<h2 style=\"font-weight: bold;\">Hierarchy<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/descendant\">ancestor descendant<\/a><\/strong>\u00a0Matches all descendant elements specified by &#8220;descendant&#8221; of elements specified by &#8220;ancestor&#8221;.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/child\">parent &gt; child<\/a><\/strong>\u00a0Matches all child elements specified by &#8220;child&#8221; of elements specified by &#8220;parent&#8221;.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/next\">prev + next<\/a><\/strong>\u00a0Matches all next elements specified by &#8220;next&#8221; that are next to elements specified by &#8220;prev&#8221;.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/siblings\">prev ~ siblings<\/a><\/strong>\u00a0Matches all sibling elements after the &#8220;prev&#8221; element that match the filtering &#8220;siblings&#8221; selector.<br \/>\n<h2 style=\"font-weight: bold;\">Basic Filters<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/first\">:first<\/a><\/strong>\u00a0Matches the first selected element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/last\">:last<\/a><\/strong>\u00a0Matches the last selected element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/not\">:not(selector)<\/a><\/strong>\u00a0Filters out all elements matching the given selector.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/even\">:even<\/a><\/strong>\u00a0Matches even elements, zero-indexed.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/odd\">:odd<\/a><\/strong>\u00a0Matches odd elements, zero-indexed.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/eq\">:eq(index)<\/a><\/strong>\u00a0Matches a single element by its index.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/gt\">:gt(index)<\/a><\/strong>\u00a0Matches all elements with an index above the given one.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/lt\">:lt(index)<\/a><\/strong>\u00a0Matches all elements with an index below the given one.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/header\">:header<\/a><\/strong>\u00a0Matches all elements that are headers, like h1, h2, h3 and so on.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/animated\">:animated<\/a><\/strong>\u00a0Matches all elements that are currently being animated.<br \/>\n<h2 style=\"font-weight: bold;\">Content Filters<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/contains\">:contains(text)<\/a><\/strong>\u00a0Matches elements which contain the given text.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/empty\">:empty<\/a><\/strong>\u00a0Matches all elements that have no children (including text nodes).<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/has\">:has(selector)<\/a><\/strong>\u00a0Matches elements which contain at least one element that matches the specified selector.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/parent\">:parent<\/a><\/strong>\u00a0Matches all elements that are parents &#8211; they have child elements, including text.<br \/>\n<h2 style=\"font-weight: bold;\">Visibility Filters<\/h2>\n<\/li>\n<\/ul>\n<p style=\"color: #444444;\"><em style=\"font-weight: bold;\">none<\/em><\/p>\n<h2 style=\"font-weight: bold; color: #444444;\">Attribute Filters<\/h2>\n<ul style=\"color: #444444;\">\n<li><strong style=\"color: #000000;\">[<a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/attributeHas\">attribute<\/a>]<\/strong>\u00a0Matches elements that have the specified attribute.<\/li>\n<li><strong style=\"color: #000000;\">[<a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/attributeEquals\">attribute=value<\/a>]<\/strong>\u00a0Matches elements that have the specified attribute with a certain value.<\/li>\n<li><strong style=\"color: #000000;\">[<a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/attributeNotEqual\">attribute!=value<\/a>]<\/strong>\u00a0Matches elements that don&#8217;t have the specified attribute with a certain value.<\/li>\n<li><strong style=\"color: #000000;\">[<a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/attributeStartsWith\">attribute^=value<\/a>]<\/strong>\u00a0Matches elements that have the specified attribute and it starts with a certain value.<\/li>\n<li><strong style=\"color: #000000;\">[<a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/attributeEndsWith\">attribute$=value<\/a>]<\/strong>\u00a0Matches elements that have the specified attribute and it ends with a certain value.<\/li>\n<li><strong style=\"color: #000000;\">[<a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/attributeContains\">attribute*=value<\/a>]<\/strong>\u00a0Matches elements that have the specified attribute and it contains a certain value.<\/li>\n<li><strong style=\"color: #000000;\">[<a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/attributeMultiple\">selector1<\/a>selector2selectorN]<\/strong>\u00a0Matches elements that have the specified attribute and it contains a certain value.<br \/>\n<h2 style=\"font-weight: bold;\">Child Filters<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/nthChild\">:nth-child(index\/even\/odd\/equation)<\/a><\/strong>\u00a0Matches all elements that are the nth-child of their parent or that are the parent&#8217;s even or odd children.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/firstChild\">:first-child<\/a><\/strong>\u00a0Matches all elements that are the first child of their parent.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/lastChild\">:last-child<\/a><\/strong>\u00a0Matches all elements that are the last child of their parent.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/onlyChild\">:only-child<\/a><\/strong>\u00a0Matches all elements that are the only child of their parent.<br \/>\n<h2 style=\"font-weight: bold;\">Forms<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/input\">:input<\/a><\/strong>\u00a0Matches all input, textarea, select and button elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/text\">:text<\/a><\/strong>\u00a0Matches all input elements of type text.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/password\">:password<\/a><\/strong>\u00a0Matches all input elements of type password.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/radio\">:radio<\/a><\/strong>\u00a0Matches all input elements of type radio.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/checkbox\">:checkbox<\/a><\/strong>\u00a0Matches all input elements of type checkbox.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/submit\">:submit<\/a><\/strong>\u00a0Matches all input elements of type submit.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/image\">:image<\/a><\/strong>\u00a0Matches all input elements of type image.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/reset\">:reset<\/a><\/strong>\u00a0Matches all input elements of type reset.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/button\">:button<\/a><\/strong>\u00a0Matches all button elements and input elements of type button.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/file\">:file<\/a><\/strong>\u00a0Matches all input elements of type file.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/hidden\">:hidden<\/a><\/strong>\u00a0Matches all elements that are hidden, or input elements of type &#8220;hidden&#8221;.<br \/>\n<h2 style=\"font-weight: bold;\">Form Filters<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/enabled\">:enabled<\/a><\/strong>\u00a0Matches all elements that are enabled.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/disabled\">:disabled<\/a><\/strong>\u00a0Matches all elements that are disabled.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/checked\">:checked<\/a><\/strong>\u00a0Matches all elements that are checked.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Selectors\/selected\">:selected<\/a><\/strong>\u00a0Matches all elements that are selected.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u5143\u7d20\u5c5e\u6027\/Attributes<\/span><\/p>\n<pre>pq('a')-&gt;attr('href', 'newVal')-&gt;removeClass('className')-&gt;html('newHtml')-&gt;...<\/pre>\n<ul style=\"color: #444444;\">\n<li>\n<h2 style=\"font-weight: bold;\">Attr<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/attr\">attr<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/attr\">($name)<\/a>\u00a0Access a property on the first matched element. This method makes it easy to retrieve a property value from the first matched element. If the element does not have an attribute with such a name, undefined is returned.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/attr\">attr<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/attr\">($properties)<\/a>\u00a0Set a key\/value object as properties to all matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/attr\">attr<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/attr\">($key, $value)<\/a>\u00a0Set a single property to a value, on all matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/attr\">attr<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/attr\">($key, $fn)<\/a>\u00a0Set a single property to a computed value, on all matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/removeAttr\">removeAttr<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/removeAttr\">($name)<\/a>\u00a0Remove an attribute from each of the matched elements.<br \/>\n<h2 style=\"font-weight: bold;\">Class<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/addClass\">addClass<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/addClass\">($class)<\/a>\u00a0Adds the specified class(es) to each of the set of matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/hasClass\">hasClass<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/hasClass\">($class)<\/a>\u00a0Returns true if the specified class is present on at least one of the set of matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/removeClass\">removeClass<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/removeClass\">($class)<\/a>\u00a0Removes all or the specified class(es) from the set of matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/toggleClass\">toggleClass<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/toggleClass\">($class)<\/a>\u00a0Adds the specified class if it is not present, removes the specified class if it is present.<br \/>\n<h2 style=\"font-weight: bold;\">HTML<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/html\">html<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/html\">()<\/a>\u00a0Get the html contents (innerHTML) of the first matched element. This property is not available on XML documents (although it will work for XHTML documents).<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/html\">html<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/html\">($val)<\/a>\u00a0Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents).<br \/>\n<h2 style=\"font-weight: bold;\">Text<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/text\">text<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/text\">()<\/a>\u00a0Get the combined text contents of all matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/text\">text<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/text\">($val)<\/a>\u00a0Set the text contents of all matched elements.<br \/>\n<h2 style=\"font-weight: bold;\">Value<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/val\">val<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/val\">()<\/a>\u00a0Get the content of the value attribute of the first matched element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/val\">val<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/val\">($val)<\/a>\u00a0Set the value attribute of every matched element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/val\">val<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Attributes\/val\">($val)<\/a>\u00a0Checks, or selects, all the radio buttons, checkboxes, and select options that match the set of values.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u8fc7\u6ee4\u5668\/\u67e5\u627e\u540e\u4ee3\u5143\u7d20Traversing<\/span><\/p>\n<pre>pq('div &gt; p')-&gt;add('div &gt; ul')-&gt;filter(':has(a)')-&gt;find('p:first')-&gt;nextAll()-&gt;andSelf()-&gt;...<\/pre>\n<ul style=\"color: #444444;\">\n<li>\n<h2 style=\"font-weight: bold;\">Filtering<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/eq\">eq<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/eq\">($index)<\/a>\u00a0Reduce the set of matched elements to a single element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/hasClass\">hasClass<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/hasClass\">($class)<\/a>\u00a0Checks the current selection against a class and returns true, if at least one element of the selection has the given class.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/filter\">filter<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/filter\">($expr)<\/a>\u00a0Removes all elements from the set of matched elements that do not match the specified expression(s).<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/filter\">filter<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/filter\">($fn)<\/a>\u00a0Removes all elements from the set of matched elements that does not match the specified function.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/is\">is<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/is\">($expr)<\/a>\u00a0Checks the current selection against an expression and returns true, if at least one element of the selection fits the given expression.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/map\">map<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/map\">($callback)<\/a>\u00a0Translate a set of elements in the jQuery object into another set of values in an array (which may, or may not, be elements).<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/not\">not<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/not\">($expr)<\/a>\u00a0Removes elements matching the specified expression from the set of matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/slice\">slice<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/slice\">($start, $end)<\/a>\u00a0Selects a subset of the matched elements.<br \/>\n<h2 style=\"font-weight: bold;\">Finding<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/add\">add<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/add\">($expr)<\/a>\u00a0Adds more elements, matched by the given expression, to the set of matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/children\">children<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/children\">($expr)<\/a>\u00a0Get a set of elements containing all of the unique immediate children of each of the matched set of elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/contents\">contents<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/contents\">()<\/a>\u00a0Find all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/find\">find<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/find\">($expr)<\/a>\u00a0Searches for all elements that match the specified expression. This method is a good way to find additional descendant elements with which to process.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/next\">next<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/next\">($expr)<\/a>\u00a0Get a set of elements containing the unique next siblings of each of the given set of elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/nextAll\">nextAll<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/nextAll\">($expr)<\/a>\u00a0Find all sibling elements after the current element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/parent\">parent<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/parent\">($expr)<\/a>\u00a0Get a set of elements containing the unique parents of the matched set of elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/parents\">parents<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/parents\">($expr)<\/a>\u00a0Get a set of elements containing the unique ancestors of the matched set of elements (except for the root element). The matched elements can be filtered with an optional expression.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/prev\">prev<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/prev\">($expr)<\/a>\u00a0Get a set of elements containing the unique previous siblings of each of the matched set of elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/prevAll\">prevAll<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/prevAll\">($expr)<\/a>\u00a0Find all sibling elements before the current element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/siblings\">siblings<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/siblings\">($expr)<\/a>\u00a0Get 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.<br \/>\n<h2 style=\"font-weight: bold;\">Chaining<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/andSelf\">andSelf<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/andSelf\">()<\/a>\u00a0Add the previous selection to the current selection.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/end\">end<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Traversing\/end\">()<\/a>\u00a0Revert the most recent &#8216;destructive&#8217; operation, changing the set of matched elements to its previous state (right before the destructive operation).<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u00a0\u5143\u7d20\u7684\u589e\u3001\u5220\u3001\u6539\/Manipulation<\/span><\/p>\n<ul style=\"color: #444444;\">\n<li>\n<h2 style=\"font-weight: bold;\">Changing Contents<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/html\">html<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/html\">()<\/a>\u00a0Get the html contents (innerHTML) of the first matched element. This property is not available on XML documents (although it will work for XHTML documents).<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/html\">html<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/html\">($val)<\/a>\u00a0Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents).<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/text\">text<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/text\">()<\/a>\u00a0Get the combined text contents of all matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/text\">text<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/text\">($val)<\/a>\u00a0Set the text contents of all matched elements.<br \/>\n<h2 style=\"font-weight: bold;\">Inserting Inside<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/append\">append<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/append\">($content)<\/a>\u00a0Append content to the inside of every matched element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/appendTo\">appendTo<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/appendTo\">($content)<\/a>\u00a0Append all of the matched elements to another, specified, set of elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/prepend\">prepend<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/prepend\">($content)<\/a>\u00a0Prepend content to the inside of every matched element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/prependTo\">prependTo<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/prependTo\">($content)<\/a>\u00a0Prepend all of the matched elements to another, specified, set of elements.<br \/>\n<h2 style=\"font-weight: bold;\">Inserting Outside<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/after\">after<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/after\">($content)<\/a>\u00a0Insert content after each of the matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/before\">before<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/before\">($content)<\/a>\u00a0Insert content before each of the matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/insertAfter\">insertAfter<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/insertAfter\">($content)<\/a>\u00a0Insert all of the matched elements after another, specified, set of elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/insertBefore\">insertBefore<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/insertBefore\">($content)<\/a>\u00a0Insert all of the matched elements before another, specified, set of elements.<br \/>\n<h2 style=\"font-weight: bold;\">Inserting Around<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrap\">wrap<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrap\">($html)<\/a>\u00a0Wrap each matched element with the specified HTML content.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrap\">wrap<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrap\">($elem)<\/a>\u00a0Wrap each matched element with the specified element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrapAll\">wrapAll<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrapAll\">($html)<\/a>\u00a0Wrap all the elements in the matched set into a single wrapper element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrapAll\">wrapAll<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrapAll\">($elem)<\/a>\u00a0Wrap all the elements in the matched set into a single wrapper element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrapInner\">wrapInner<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrapInner\">($html)<\/a>\u00a0Wrap the inner child contents of each matched element (including text nodes) with an HTML structure.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrapInner\">wrapInner<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/wrapInner\">($elem)<\/a>\u00a0Wrap the inner child contents of each matched element (including text nodes) with a DOM element.<br \/>\n<h2 style=\"font-weight: bold;\">Replacing<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/replaceWith\">replaceWith<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/replaceWith\">($content)<\/a>\u00a0Replaces all matched elements with the specified HTML or DOM elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/replaceAll\">replaceAll<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/replaceAll\">($selector)<\/a>\u00a0Replaces the elements matched by the specified selector with the matched elements.<br \/>\n<h2 style=\"font-weight: bold;\">Removing<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/empty\">empty<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/empty\">()<\/a>\u00a0Remove all child nodes from the set of matched elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/remove\">remove<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/remove\">($expr)<\/a>\u00a0Removes all matched elements from the DOM.<br \/>\n<h2 style=\"font-weight: bold;\">Copying<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/clone\">clone<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/clone\">()<\/a>\u00a0Clone matched DOM Elements and select the clones.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/clone\">clone<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Manipulation\/clone\">($true)<\/a>\u00a0Clone matched DOM Elements, and all their event handlers, and select the clones.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">php\u7248\u672c\u7684Ajax<\/span><\/p>\n<h2 style=\"font-weight: bold; color: #444444;\">Ajax Requests<\/h2>\n<ul style=\"color: #444444;\">\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.ajax\">phpQuery::ajax<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.ajax\">($options)<\/a>\u00a0Load a remote page using an HTTP request.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/load\">load<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/load\">($url, $data, $callback)<\/a>\u00a0Load HTML from a remote file and inject it into the DOM.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.get\">phpQuery::get<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.get\">($url, $data, $callback)<\/a>\u00a0Load a remote page using an HTTP GET request.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.getJSON\">phpQuery::getJSON<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.getJSON\">($url, $data, $callback)<\/a>\u00a0Load JSON data using an HTTP GET request.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.getScript\">phpQuery::getScript<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.getScript\">($url, $callback)<\/a>\u00a0Loads, and executes, a local JavaScript file using an HTTP GET request.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.post\">phpQuery::post<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.post\">($url, $data, $callback, $type)<\/a>\u00a0Load a remote page using an HTTP POST request.<br \/>\n<h2 style=\"font-weight: bold;\">Ajax Events<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxComplete\">ajaxComplete<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxComplete\">($callback)<\/a>\u00a0Attach a function to be executed whenever an AJAX request completes. This is an Ajax Event.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxError\">ajaxError<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxError\">($callback)<\/a>\u00a0Attach a function to be executed whenever an AJAX request fails. This is an Ajax Event.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxSend\">ajaxSend<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxSend\">($callback)<\/a>\u00a0Attach a function to be executed before an AJAX request is sent. This is an Ajax Event.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxStart\">ajaxStart<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxStart\">($callback)<\/a>\u00a0Attach a function to be executed whenever an AJAX request begins and there is none already active. This is an Ajax Event.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxStop\">ajaxStop<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxStop\">($callback)<\/a>\u00a0Attach a function to be executed whenever all AJAX requests have ended. This is an Ajax Event.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxSuccess\">ajaxSuccess<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/ajaxSuccess\">($callback)<\/a>\u00a0Attach a function to be executed whenever an AJAX request completes successfully. This is an Ajax Event.<br \/>\n<h2 style=\"font-weight: bold;\">Misc<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.ajaxSetup\">phpQuery::ajaxSetup<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/jQuery.ajaxSetup\">($options)<\/a>\u00a0Setup global settings for AJAX requests.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/serialize\">serialize<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/serialize\">()<\/a>\u00a0Serializes a set of input elements into a string of data. This will serialize all given elements.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/serializeArray\">serializeArray<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Ajax\/serializeArray\">()<\/a>\u00a0Serializes all forms and form elements (like the .serialize() method) but returns a JSON data structure for you to work with.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u4e8b\u4ef6\/Events<\/span><\/p>\n<pre>pq('form')-&gt;bind('submit', 'submitHandler')-&gt;trigger('submit')-&gt;... \r\nfunction submitHandler($e) { \r\n  print 'Target: '.$e-&gt;target-&gt;tagName; \r\n  print 'Bubbling ? '.$e-&gt;currentTarget-&gt;tagName; \r\n}<\/pre>\n<h2 style=\"font-weight: bold; color: #444444;\">Event Handling<\/h2>\n<ul style=\"color: #444444;\">\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/bind\">bind<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/bind\">($type, $data, $fn)<\/a>\u00a0Binds a handler to one or more events (like click) for each matched element. Can also bind custom events.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/one\">one<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/one\">($type, $data, $fn)<\/a>\u00a0Binds a handler to one or more events to be executed once for each matched element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/trigger\">trigger<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/trigger\">($type , $data )<\/a>\u00a0Trigger a type of event on every matched element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/triggerHandler\">triggerHandler<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/triggerHandler\">($type , $data )<\/a>\u00a0This particular method triggers all bound event handlers on an element (for a specific event type) WITHOUT executing the browsers default actions.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/unbind\">unbind<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/unbind\">($type , $data )<\/a>\u00a0This does the opposite of bind, it removes bound events from each of the matched elements.<\/li>\n<\/ul>\n<h2 style=\"font-weight: bold; color: #444444;\">Interaction Helpers<\/h2>\n<p style=\"color: #444444;\"><em style=\"font-weight: bold;\">none<\/em><\/p>\n<h2 style=\"font-weight: bold; color: #444444;\">Event Helpers<\/h2>\n<ul style=\"color: #444444;\">\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/change\">change<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/change\">()<\/a>\u00a0Triggers the change event of each matched element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/change\">change<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/change\">($fn)<\/a>\u00a0Binds a function to the change event of each matched element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/submit\">submit<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/submit\">()<\/a>\u00a0Trigger the submit event of each matched element.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/submit\">submit<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Events\/submit\">($fn)<\/a>\u00a0Bind a function to the submit event of each matched element.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u00a0\u5bf9\u8c61\u3001\u6570\u7ec4\u3001\u51fd\u6570\u5de5\u5177\/Utilities<\/span><\/p>\n<h2 style=\"font-weight: bold; color: #444444;\">Array and Object operations<\/h2>\n<ul style=\"color: #444444;\">\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.each\">phpQuery::each<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.each\">($object, $callback)<\/a>\u00a0A generic iterator function, which can be used to seamlessly iterate over both objects and arrays.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.grep\">phpQuery::grep<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.grep\">($array, $callback, $invert)<\/a>\u00a0Filter items out of an array, by using a filter function.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.makeArray\">phpQuery::makeArray<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.makeArray\">($obj)<\/a>\u00a0Turns an array-like object into a true array.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.map\">phpQuery::map<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.map\">($array, $callback)<\/a>\u00a0Translate all items in an array to another array of items.<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.inArray\">phpQuery::inArray<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.inArray\">($value, $array)<\/a>\u00a0Determine the index of the first parameter in the Array (-1 if not found).<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.unique\">phpQuery::unique<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.unique\">($array)<\/a>\u00a0Remove all duplicate elements from an array of elements.<br \/>\n<h2 style=\"font-weight: bold;\">Test operations<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.isFunction\">phpQuery::isFunction<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.isFunction\">($obj)<\/a>\u00a0Determine if the parameter passed is a function.<br \/>\n<h2 style=\"font-weight: bold;\">String operations<\/h2>\n<\/li>\n<li><strong style=\"color: #000000;\"><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.trim\">phpQuery::trim<\/a><\/strong><a style=\"color: #7759ae;\" href=\"http:\/\/docs.jquery.com\/Utilities\/jQuery.trim\">($str)<\/a>\u00a0Remove the whitespace from the beginning and end of a string.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u00a0JSON<\/span><\/p>\n<pre>$jsonString = phpQuery::toJSON( pq('form')-&gt;serializeArray() ); \r\n$array = phpQuery::parseJSON('{\"foo\": \"bar\"}');<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>phpquery.php\u7684\u597d\u5904\u53ef\u4ee5\u8ddfjquery\u4e00\u6837\u53bb\u64cd\u4f5cDOM\uff0c\u5bf9\u8c61\u548c\u6570\u7ec4\uff0c\u514d\u53bb\u4e86\u5b66\u4e60\u65b0\u7684API\u3002 \u5728\u4f7f\u7528p [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-5084","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5084"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5084\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}