diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/formdata/keys | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/api/formdata/keys')
-rw-r--r-- | files/ja/web/api/formdata/keys/index.html | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/files/ja/web/api/formdata/keys/index.html b/files/ja/web/api/formdata/keys/index.html new file mode 100644 index 0000000000..0e9fd69673 --- /dev/null +++ b/files/ja/web/api/formdata/keys/index.html @@ -0,0 +1,77 @@ +--- +title: FormData.keys() +slug: Web/API/FormData/keys +tags: + - API + - FormData + - Iterator + - Method + - Reference + - XMLHttpRequest API +translation_of: Web/API/FormData/keys +--- +<p>{{APIRef("XMLHttpRequest")}}</p> + +<p><code><strong>FormData.keys()</strong></code> メソッドは、 {{jsxref("Iteration_protocols",'iterator')}} を返し、このオブジェクトに含まれる全てのキーを通過できるようにします。キーは {{domxref("USVString")}} オブジェクトです。</p> + +<div class="note"> +<p><strong>Note</strong>: このメソッドは <a href="/en-US/docs/Web/API/Web_Workers_API">Web Workers</a> で使用できます。</p> +</div> + +<h2 id="構文">構文</h2> + +<pre class="syntaxbox notranslate">formData.keys();</pre> + +<h3 id="返り値">返り値</h3> + +<p>{{jsxref("Iteration_protocols","iterator")}} を返します。</p> + +<h2 id="例">例</h2> + +<pre class="brush: js;highlight:[7] notranslate">// テストの FormData オブジェクトを作成 +var formData = new FormData(); +formData.append('key1', 'value1'); +formData.append('key2', 'value2'); + +// キーを表示 +for (var key of formData.keys()) { + console.log(key); +} +</pre> + +<p>結果は次のとおりです:</p> + +<pre class="notranslate">key1 +key2</pre> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様</th> + <th scope="col">ステータス</th> + <th scope="col">備考</th> + </tr> + <tr> + <td>{{SpecName('XMLHttpRequest','#dom-formdata','keys() (as iterator<>)')}}</td> + <td>{{Spec2('XMLHttpRequest')}}</td> + <td>初回定義</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザー実装状況">ブラウザー実装状況</h2> + + + +<p>{{Compat("api.FormData.keys")}}</p> + +<h2 id="関連項目">関連項目</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> |