FormData

  • Revision slug: DOM/XMLHttpRequest/FormData
  • Revision title: FormData
  • Revision id: 12845
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment no wording changes

Revision Content

{{ gecko_minversion_header("1.9.3") }}

XMLHttpRequest Level 2 adds support for the new FormData interface. FormData objects provide a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest send() method.

Method overview

void append(in DOMString name, in {{ interface("nsIVariant") }} value);

Methods

append()

Appends a key/value pair to the FormData object.

void append(
  in DOMString name,
  in nsIVariant value
); 
Parameters
name
The name of the field whose data is contained in value.
value
The field's value.

See also

Revision Source

<p>{{ gecko_minversion_header("1.9.3") }}</p>
<p>XMLHttpRequest Level 2 adds support for the new <code>FormData</code> interface. <code>FormData</code> objects provide a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest <a href="/en/XMLHttpRequest#send()" title="en/XMLHttpRequest#send()"><code>send()</code></a> method.</p>
<h2 name="Method_overview">Method overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>void <a href="/en/XMLHttpRequest/FormData#append()" title="en/XMLHttpRequest/FormData#append()">append</a>(in DOMString name, in {{ interface("nsIVariant") }} value);</code></td> </tr> </tbody>
</table>
<h2>Methods</h2>
<h3>append()</h3>
<p>Appends a key/value pair to the <code>FormData</code> object.</p>
<pre>void append(
  in DOMString name,
  in nsIVariant value
); 
</pre>
<h6>Parameters</h6>
<dl> <dt><code>name</code></dt> <dd>The name of the field whose data is contained in <code>value</code>.</dd> <dt><code>value</code></dt> <dd>The field's value.</dd>
</dl><h2>See also</h2>
<ul> <li><a href="/en/XMLHttpRequest" title="en/XMLHttpRequest">XMLHttpRequest</a></li> <li><a href="/En/Using_XMLHttpRequest" title="En/Using XMLHttpRequest">Using XMLHttpRequest<br> </a></li> <li><a href="/en/XMLHttpRequest/Submitting_forms_with_FormData_objects" title="en/XMLHttpRequest/Submitting forms with FormData objects">Submitting forms with FormData objects</a></li> <li><a href="/en/HTML/Element/form" title="en/HTML/Element/form"><code>form</code></a></li>
</ul>
Revert to this revision