aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/formdata/getall/index.html
blob: 6de19365e54541ac7678029f23ed295aae771776 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
title: FormData.getAll()
slug: Web/API/FormData/getAll
translation_of: Web/API/FormData/getAll
---
<p>{{APIRef("XMLHttpRequest")}}</p>

<p>{{domxref("FormData")}} 인터페이스의 <code><strong>getAll()</strong></code> 메서드는 <code>FormData</code> 객체에서 지정된 키와 연관된 모든 값을 반환합니다.</p>

<div class="note">
<p><strong>메모</strong>: 이 메서드는 웹워커<a href="/ko/docs/Web/API/Web_Workers_API">(Web Workers)</a>에서도 사용할 수 있습니다.</p>
</div>

<h2 id="Syntax">Syntax</h2>

<pre class="brush: js">formData.getAll(name);</pre>

<h3 id="append()_Parameters" name="append()_Parameters">Parameters</h3>

<dl>
 <dt><code>name</code></dt>
 <dd>검색하고 싶은 키의 이름을 나타내는 {{domxref("USVString")}} 입니다.</dd>
</dl>

<h3 id="Returns">Returns</h3>

<p>{{domxref("FormDataEntryValue")}}의 배열입니다.</p>

<h2 id="Example">Example</h2>

<p>다음 코드를 따라 빈 <code>FormData</code> 객체를 만듭니다:</p>

<pre class="brush: js">var formData = new FormData();</pre>

<p>{{domxref("FormData.append")}}를 사용하여 <code>username</code> 에 두 개의 값을 추가합니다:</p>

<pre class="brush: js">formData.append('username', 'Chris');
formData.append('username', 'Bob');</pre>

<p><code>getAll()</code> 함수는 <code>username</code> 의 값들을 배열로 반환합니다:</p>

<pre class="brush: js">formData.getAll('username'); // Returns ["Chris", "Bob"]</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('XMLHttpRequest','#dom-formdata-getall','getAll()')}}</td>
   <td>{{Spec2('XMLHttpRequest')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>



<p>{{Compat("api.FormData.getAll")}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{domxref("XMLHTTPRequest")}}</li>
 <li><a href="/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest" title="Using XMLHttpRequest">Using XMLHttpRequest</a></li>
 <li><a href="/en-US/docs/DOM/XMLHttpRequest/FormData/Using_FormData_Objects" title="DOM/XMLHttpRequest/FormData/Using_FormData_objects">Using FormData objects</a></li>
 <li>{{HTMLElement("Form")}}</li>
</ul>