aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/glossary/jquery
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/glossary/jquery
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/glossary/jquery')
-rw-r--r--files/zh-cn/glossary/jquery/index.html58
1 files changed, 58 insertions, 0 deletions
diff --git a/files/zh-cn/glossary/jquery/index.html b/files/zh-cn/glossary/jquery/index.html
new file mode 100644
index 0000000000..f0a4d1ce37
--- /dev/null
+++ b/files/zh-cn/glossary/jquery/index.html
@@ -0,0 +1,58 @@
+---
+title: jQuery
+slug: Glossary/jQuery
+tags:
+ - JQuery
+ - JavaScript
+ - 术语
+translation_of: Glossary/jQuery
+---
+<p><strong>jQuery</strong> 是一个着重简化 {{Glossary("DOM")}} 操作,{{Glossary("AJAX")}} 调用和{{Glossary("Event", "事件")}}处理的 {{Glossary("JavaScript")}} {{Glossary("Library", "库")}}。一些前端 JavaScript 开发者经常会用到它。</p>
+
+<p>jQuery 使用 <code>$(selector).action()</code> 的格式给一个(或多个)元素绑定事件。具体来说,<code>$(selector)</code> 让 jQuery 选择匹配 CSS 选择器 <code>selector</code> 的元素,并将它/它们传递给叫做 <code>.action()</code> 的事件 {{Glossary("API")}}。</p>
+
+<pre class="brush: js"><code class="language-js">$(document).ready(function(){
+ alert("Hello World!");
+ $("#blackBox").hide();
+});</code></pre>
+
+<p>上述代码和以下代码功能相同:</p>
+
+<pre class="brush: js"><code class="language-js">window.onload = function() {
+ alert( "Hello World!" );
+ document.getElementById("blackBox").style.display = "none";
+};</code></pre>
+
+<h2 id="下载_jQuery">下载 jQuery</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">npm</th>
+ <th scope="col">bower(单文件)</th>
+ <th scope="col">Google CDN</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><code>npm install jquery</code></td>
+ <td><code>bower install https://code.jquery.com/jquery-3.2.1.min.js</code></td>
+ <td><code>https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js</code></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="更多学习">更多学习</h2>
+
+<h3 id="基本知识">基本知识</h3>
+
+<ul>
+ <li>维基百科上的 {{Interwiki("wikipedia", "jQuery")}}</li>
+ <li><a href="http://jquery.com/">jQuery 官方网站</a></li>
+</ul>
+
+<h3 id="技术信息">技术信息</h3>
+
+<ul>
+ <li><a href="https://api.jquery.com/">官方 API 文档</a></li>
+</ul>