aboutsummaryrefslogtreecommitdiff
path: root/files/vi/glossary/jquery/index.html
blob: 1477abfb668c0eb71a1bb3642f7971012958f387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
title: jQuery
slug: Tu-dien-thuat-ngu/jQuery
translation_of: Glossary/jQuery
---
<p><span class="seoSummary"><strong>jQuery</strong> là một {{Glossary("JavaScript")}} {{Glossary("Library")}} </span>tập trung vào việc đơn giản hóa<span class="seoSummary"> thao tác vơi {{Glossary("DOM")}}, gọi {{Glossary("AJAX")}}, và điều khiển {{Glossary("Event")}}.</span></p>

<p>jQuery sử dụng định dạng, <code>$(selector).action()</code> để gán một phần tử cho một sự kiện. Để giải thích chi tiết hơn, <code>$(selector)</code> sẽ gọi jQuery để chọn phần tử <code>selector</code> , và gán nó cho một sự kiện {{Glossary("API")}} gọi là <code>.action()</code>.</p>

<pre class="brush: js notranslate">$(document).ready(function(){
  alert("Hello World!");
  $("#blackBox").hide();
});</pre>

<p>Đoạn mã trên thực hiện chức năng tương tự như đoạn mã sau:</p>

<pre class="brush: js notranslate">window.onload = function() {
  alert("Hello World!");
  document.getElementById("blackBox").style.display = "none";
};</pre>

<p>Hoặc:</p>

<pre class="brush: js notranslate">window.addEventListener("load", () =&gt; {
  alert("Hello World!");
  document.getElementById("blackBox").style.display = "none";
});</pre>

<h2 id="Tìm_hiểu_thêm">Tìm hiểu thêm</h2>

<h3 id="Kiến_thức_chung">Kiến thức chung</h3>

<ul>
 <li>{{Interwiki("wikipedia", "jQuery")}} on Wikipedia</li>
 <li><a href="https://jquery.com/">jQuery Official Website</a></li>
</ul>

<h3 id="Thông_tin_kĩ_thuật">Thông tin kĩ thuật</h3>

<ul>
 <li><a href="https://api.jquery.com/">Offical API reference documentation</a><a href="https://api.jquery.com/"> </a></li>
</ul>