aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/formdata/delete/index.html
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-11 12:56:40 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-11 12:56:40 +0100
commit310fd066e91f454b990372ffa30e803cc8120975 (patch)
treed5d900deb656a5da18e0b60d00f0db73f3a2e88e /files/zh-cn/web/api/formdata/delete/index.html
parent8260a606c143e6b55a467edf017a56bdcd6cba7e (diff)
downloadtranslated-content-310fd066e91f454b990372ffa30e803cc8120975.tar.gz
translated-content-310fd066e91f454b990372ffa30e803cc8120975.tar.bz2
translated-content-310fd066e91f454b990372ffa30e803cc8120975.zip
unslug zh-cn: move
Diffstat (limited to 'files/zh-cn/web/api/formdata/delete/index.html')
-rw-r--r--files/zh-cn/web/api/formdata/delete/index.html71
1 files changed, 71 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/formdata/delete/index.html b/files/zh-cn/web/api/formdata/delete/index.html
new file mode 100644
index 0000000000..9d38b4e20a
--- /dev/null
+++ b/files/zh-cn/web/api/formdata/delete/index.html
@@ -0,0 +1,71 @@
+---
+title: FormData.delete()
+slug: Web/API/FormData/删除
+tags:
+ - 删除
+translation_of: Web/API/FormData/delete
+---
+<p>{{APIRef("XMLHttpRequest")}}</p>
+
+<p>{{domxref("FormData")}} 接口的 <code><strong>delete()</strong></code> 方法会从 <code>FormData</code> 对象中删除指定键,即 key,和它对应的值,即 value。</p>
+
+<div class="note">
+<p><strong>Note</strong>: 此方法可用于 <a href="/zh-CN/docs/Web/API/Web_Workers_API">Web Workers</a>。</p>
+</div>
+
+<h2 id="语法">语法</h2>
+
+<pre class="brush: js">formData.delete(name);</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>name</code></dt>
+ <dd>要删除的键(Key)的名字。</dd>
+</dl>
+
+<h3 id="返回">返回</h3>
+
+<p>空。</p>
+
+<h2 id="例子">例子</h2>
+
+<p>以下代码将会创建一个空的 <code>FormData</code> 对象, 并且从指定的表单中获取键值对:</p>
+
+<pre class="brush: js">var formData = new FormData(myForm);</pre>
+
+<p>你可以通过 <code>delete()</code> 方法来删除键值对:</p>
+
+<pre class="brush: js">formData.delete('username');</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-delete','delete()')}}</td>
+ <td>{{Spec2('XMLHttpRequest')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.FormData.delete")}}</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>