
{"id":2490,"date":"2020-11-20T09:25:37","date_gmt":"2020-11-20T01:25:37","guid":{"rendered":"http:\/\/admin.evshou.com\/?p=2490"},"modified":"2020-11-23T11:29:06","modified_gmt":"2020-11-23T03:29:06","slug":"2020javaweb%e6%95%99%e7%a8%8b%e4%b9%8bjquery%e5%92%8cjquery%e9%80%89%e6%8b%a9%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.9713job.com\/?p=2490","title":{"rendered":"2020javaweb\u6559\u7a0b\u4e4bjQuery\u548cjQuery\u9009\u62e9\u5668"},"content":{"rendered":"<h3>2020javaweb\u6559\u7a0b\u4e4bjQuery\u548cjQuery\u9009\u62e9\u5668<\/h3>\n<p>\u6982\u8ff0\uff1a<br \/>\njQuery\u662f\u4e00\u4e2a\u5feb\u901f\u3001\u7b80\u6d01\u7684JavaScript\u6846\u67b6\u3002<br \/>\njQuery\u8bbe\u8ba1\u7684\u5b97\u65e8\u662f\u201cWrite Less\uff0cDo More\u201d\uff0c\u5373\u5021\u5bfc\u5199\u66f4\u5c11\u7684\u4ee3\u7801\uff0c\u505a\u66f4\u591a\u7684\u4e8b\u60c5\u3002<\/p>\n<p>\u4ec0\u4e48\u662fjQuery\uff1f<br \/>\njQuery\u662f\u4e00\u4e2aJavaScript\u51fd\u6570\u5e93<\/p>\n<p>\u4e0b\u8f7djQuery\uff1a<br \/>\n1 <a href=\"http:\/\/jquery.com\" target=\"_blank\" rel=\"noopener noreferrer\">jQuery.com <\/a>\u4e0b\u8f7djQuery\u5e93<br \/>\n2.\u4eceCDN\u4e2d\u8f7d\u5165jQuery<\/p>\n<p>\u8bed\u6cd5\uff1a&lt;script src=&#8221;uri&#8221;&gt;&lt;\/script&gt;<br \/>\n<!--more--><\/p>\n<p>\u767e\u5ea6cdn\uff1a<br \/>\n&lt;script src=&#8221;https:\/\/apps.bdimg.com\/libs\/jquery\/2.1.4\/jquery.min.js&#8221;&gt;<\/p>\n<p>\u65b0\u6d6acdn\uff1a<br \/>\n&lt;script src=&#8221;http:\/\/lib.sinaapp.com\/js\/jquery\/2.0.2\/jquery-2.0.2.min.js&#8221;&gt;<\/p>\n<p>Google CDN\uff1a<br \/>\n&lt;script src=&#8221;http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.10.2\/jquery.min.js&#8221;&gt;<\/p>\n<p>Microsoft CDN\uff1a<br \/>\n&lt;script src=&#8221;http:\/\/ajax.htmlnetcdn.com\/ajax\/jQuery\/jquery-1.10.2.min.js&#8221;&gt;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>jQuery\u8bed\u6cd5\uff1a<\/strong><\/span><\/p>\n<pre>&lt;script&gt;\r\n  $(function(){\r\n    alert(\"\u6267\u884cjQuery\u8bed\u53e5\");\r\n  })\r\n&lt;\/script&gt;<\/pre>\n<p><span style=\"color: #ff0000;\"><strong>jQuery\u9009\u62e9\u5668<\/strong><\/span><\/p>\n<pre><strong><span style=\"color: #ff0000;\">\u5143\u7d20\u9009\u62e9\u5668<\/span><\/strong><\/pre>\n<pre>&lt;p id=\"p1\"&gt;p1&lt;\/p&gt;\r\n&lt;p class=\"p2\"&gt;p2&lt;\/p&gt;\r\n&lt;button id=\"btn1\"&gt;\u9690\u85cfp\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn2\"&gt;\u9690\u85cfp1\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn3\"&gt;\u9690\u85cfp2\u6807\u7b7e&lt;\/button&gt;\r\n&lt;script&gt;\r\n  $(function(){\r\n    <strong><span style=\"color: #ff0000;\">\/\/\u5143\u7d20\u9009\u62e9\u5668<\/span><\/strong>\r\n<strong><span style=\"color: #ff0000;\">    $(\"#btn1\").click(function () {<\/span><\/strong>\r\n<strong><span style=\"color: #ff0000;\">      $(\"p\").hide();<\/span><\/strong>\r\n<strong><span style=\"color: #ff0000;\">    });<\/span><\/strong>\r\n    <strong>\/\/id\u9009\u62e9\u5668<\/strong>\r\n<strong>    $(\"#btn2\").click(function(){<\/strong>\r\n<strong>      $(\"#p1\").hide();<\/strong>\r\n<strong>    });<\/strong>\r\n<strong>    \/\/class\u9009\u62e9\u5668<\/strong>\r\n<strong>    $(\"#btn3\").click(function () {<\/strong>\r\n<strong>      $(\".p2\").hide();<\/strong>\r\n<strong>    });<\/strong>\r\n  })\r\n&lt;\/script&gt;<\/pre>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/19\/12.png\" alt=\"\" width=\"680\" \/><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u5c42\u7ea7\u9009\u62e9\u5668<\/strong><\/span><\/p>\n<pre>&lt;div id=\"div\"&gt;\r\n  &lt;p id=\"p1\"&gt;div_p1&lt;\/p&gt;\r\n  &lt;p&gt;div_p2&lt;\/p&gt;\r\n  &lt;p&gt;div_p3&lt;\/p&gt;\r\n  &lt;ul&gt;\r\n    &lt;li id=\"li1\"&gt;li1&lt;\/li&gt;\r\n    &lt;li class=\"li2\"&gt;li2&lt;\/li&gt;\r\n    &lt;li&gt;li3&lt;\/li&gt;\r\n  &lt;\/ul&gt;\r\n  &lt;div id=\"div2\"&gt;\r\n    &lt;p&gt;div_div2_p1&lt;\/p&gt;\r\n    &lt;p&gt;div_div2_p2&lt;\/p&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n&lt;button id=\"btn1\"&gt;\u6539\u53d8div\u7684\u6240\u6709p\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn2\"&gt;\u6539\u53d8div\u540e\u9762\u7684p\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn3\"&gt;\u6539\u53d8div_p1\u540e\u9762\u7684p\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn4\"&gt;\u6539\u53d8div_p1\u540c\u7ea7\u522b\u7684\u6807\u7b7e&lt;\/button&gt;\r\n&lt;script&gt;\r\n  $(function(){\r\n    $(\"#btn1\").click(function () {\/\/\u540e\u4ee3\u9009\u62e9\u5668\r\n      $(\"#div p\").css(\"color\",\"red\");\r\n    });\r\n    $(\"#btn2\").click(function(){\/\/\u7236\u5b50\u9009\u62e9\u5668\r\n      $(\"#div&gt;p\").css(\"color\",\"orange\");\r\n    });\r\n    $(\"#btn3\").click(function () {\/\/\u540c\u8f88\u9009\u62e9\u5668\r\n      $(\"#p1+p\").css(\"color\",\"green\");\r\n    });\r\n    $(\"#btn4\").click(function () {\/\/\u540e\u7eed\u540c\u8f88\u9009\u62e9\u5668\r\n      $(\"#p1~p\").css(\"color\",\"blue\");\r\n    });\r\n  })\r\n&lt;\/script&gt;<\/pre>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/19\/13.png\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/19\/14.png\" alt=\"\" width=\"680\" \/><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u8fc7\u6ee4\u9009\u62e9\u5668<\/strong><\/span><\/p>\n<pre>&lt;div id=\"div\"&gt;\r\n  &lt;p id=\"p1\"&gt;div_p1&lt;\/p&gt;\r\n  &lt;p&gt;div_p2&lt;\/p&gt;\r\n  &lt;p&gt;div_p3&lt;\/p&gt;\r\n  &lt;ul&gt;\r\n    &lt;li&gt;li1&lt;\/li&gt;\r\n    &lt;li&gt;li2&lt;\/li&gt;\r\n    &lt;li&gt;li3&lt;\/li&gt;\r\n  &lt;\/ul&gt;\r\n  &lt;div id=\"div2\"&gt;\r\n    &lt;p&gt;div_div2_p1&lt;\/p&gt;\r\n    &lt;p&gt;div_div2_p2&lt;\/p&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n&lt;button id=\"btn1\"&gt;\u6539\u53d8\u7b2c\u4e00\u4e2ali\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn2\"&gt;\u6539\u53d8li2\u4e4b\u540e\u7684li\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn3\"&gt;\u6539\u53d8\u9664li1\u4ee5\u5916\u7684li\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn4\"&gt;\u6539\u53d8\u5c0f\u4e8eli3\u4ee5\u5916\u7684\u6807\u7b7e&lt;\/button&gt;\r\n&lt;script&gt;\r\n  $(function(){\r\n    $(\"#btn1\").click(function () {\/\/<strong>\u6539\u53d8\u7b2c\u4e00\u4e2ali\u6807\u7b7e<\/strong>\r\n      $(\"#div li:first\").css(\"color\",\"orange\");\r\n    });\r\n    $(\"#btn2\").click(function(){\/\/<strong>\u6539\u53d8\u5927\u4e8e\u7b2c\u4e8c\u4e2ali\u6807\u7b7e<\/strong>\r\n      $(\"#div li:gt(1)\").css(\"color\",\"red\");\r\n    });\r\n    $(\"#btn3\").click(function(){\/\/<strong>\u6539\u53d8\u9664\u7b2c\u4e00\u4e2ali\u6807\u7b7e<\/strong>\r\n      $(\"#div li:not(:first)\").css(\"color\",\"green\");\r\n    });\r\n    $(\"#btn4\").click(function(){\/\/<strong>\u6539\u53d8\u5c0f\u4e8e\u7b2c\u4e09\u4e2ali\u6807\u7b7e<\/strong>\r\n      $(\"#div li:lt(2)\").css(\"color\",\"red\");\r\n    });\r\n  })\r\n&lt;\/script&gt;<\/pre>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/20\/1.png\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/20\/2.png\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/20\/3.jpg\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/20\/4.jpg\" alt=\"\" width=\"680\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #ff0000;\">\u5c5e\u6027\u9009\u62e9\u5668<\/span><\/strong><\/p>\n<pre>&lt;div id=\"div\"&gt;\r\n  &lt;ul&gt;\r\n    &lt;li class=\"li1\"&gt;li1&lt;\/li&gt;\r\n    &lt;li class=\"li2\"&gt;li2&lt;\/li&gt;\r\n    &lt;li class=\"ali3\"&gt;ali3&lt;\/li&gt;\r\n  &lt;\/ul&gt;\r\n&lt;\/div&gt;\r\n&lt;button id=\"btn1\"&gt;\u6539\u53d8li\u5f00\u5934\u7684li\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn2\"&gt;\u6539\u53d8id\u4e3ali2\u7684li\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn3\"&gt;\u6539\u53d8a\u5f00\u5934\u7684li\u6807\u7b7e&lt;\/button&gt;\r\n&lt;button id=\"btn4\"&gt;\u6539\u53d82\u7ed3\u5c3e\u7684li\u6807\u7b7e&lt;\/button&gt;\r\n&lt;script&gt;\r\n  $(function(){\r\n    $(\"#btn1\").click(function(){\/\/<strong>\u6709class\u5c5e\u6027\u7684li<\/strong>\r\n      $(\"#div li[class]\").css(\"color\",\"red\");\r\n    });\r\n    $(\"#btn2\").click(function(){\/\/<strong>class\u4e3a li2\u7684li<\/strong>\r\n      $(\"#div li[class='li2']\").css(\"color\",\"orange\");\r\n    });\r\n    $(\"#btn3\").click(function(){\/\/<strong>class\u4e3a a\u5f00\u5934\u7684li<\/strong>\r\n      $(\"#div li[class^=a]\").css(\"color\",\"green\");\r\n    });\r\n    $(\"#btn4\").click(function(){\/\/<strong>class\u4e3a 2\u7ed3\u5c3e\u7684li<\/strong>\r\n      $(\"#div li[class$='2']\").css(\"color\",\"blue\");\r\n    });\r\n  })\r\n&lt;\/script&gt;<\/pre>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/20\/3.png\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/20\/4.png\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/20\/5.jpg\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/20\/6.jpg\" alt=\"\" width=\"680\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2020javaweb\u6559\u7a0b\u4e4bjQuery\u548cjQuery\u9009\u62e9\u5668 \u6982\u8ff0\uff1a jQuery\u662f\u4e00\u4e2a\u5feb\u901f\u3001\u7b80\u6d01\u7684JavaS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-2490","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts\/2490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2490"}],"version-history":[{"count":1,"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts\/2490\/revisions"}],"predecessor-version":[{"id":2491,"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts\/2490\/revisions\/2491"}],"wp:attachment":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}