diff options
author | julieng <julien.gattelier@gmail.com> | 2021-10-02 17:20:24 +0200 |
---|---|---|
committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-10-02 17:30:20 +0200 |
commit | 1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde (patch) | |
tree | 30a56efd3eff3a01bd1611e1840fdbbfacf544a4 /files/fr/web/api/xmlhttprequesteventtarget/onload | |
parent | c05efa8d7ae464235cf83d7c0956e42dc6974103 (diff) | |
download | translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.gz translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.bz2 translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.zip |
convert content to md
Diffstat (limited to 'files/fr/web/api/xmlhttprequesteventtarget/onload')
-rw-r--r-- | files/fr/web/api/xmlhttprequesteventtarget/onload/index.md | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/files/fr/web/api/xmlhttprequesteventtarget/onload/index.md b/files/fr/web/api/xmlhttprequesteventtarget/onload/index.md index 8a6afa0393..b3242e022c 100644 --- a/files/fr/web/api/xmlhttprequesteventtarget/onload/index.md +++ b/files/fr/web/api/xmlhttprequesteventtarget/onload/index.md @@ -3,54 +3,38 @@ title: XMLHttpRequestEventTarget.onload slug: Web/API/XMLHttpRequestEventTarget/onload translation_of: Web/API/XMLHttpRequestEventTarget/onload --- -<p> </p> +{{APIRef("XMLHttpRequest")}} -<div>{{APIRef("XMLHttpRequest")}}</div> +The **`XMLHttpRequestEventTarget.onload`** is the function called when an {{domxref("XMLHttpRequest")}} transaction completes successfully. -<p>The <strong><code>XMLHttpRequestEventTarget.onload</code></strong> is the function called when an {{domxref("XMLHttpRequest")}} transaction completes successfully.</p> +## Syntax -<h2 id="Syntax">Syntax</h2> + XMLHttpRequest.onload = callback; -<pre class="syntaxbox"><em>XMLHttpRequest</em>.onload = <em>callback</em>;</pre> +### Values -<h3 id="Values">Values</h3> +- `callback` is the function to be executed when the request completes successfully. It receives a {{domxref("ProgressEvent")}} object as its first argument. The value of *this* (i.e. the context) is the same {{domxref("XMLHttpRequest")}} this callback is related to. -<ul> - <li><code><em>callback</em></code> is the function to be executed when the request completes successfully. It receives a {{domxref("ProgressEvent")}} object as its first argument. The value of <em>this</em> (i.e. the context) is the same {{domxref("XMLHttpRequest")}} this callback is related to.</li> -</ul> +## Example -<h2 id="Example">Example</h2> - -<pre class="brush: js">var xmlhttp = new XMLHttpRequest(), +```js +var xmlhttp = new XMLHttpRequest(), method = 'GET', url = 'https://developer.mozilla.org/'; -xmlhttp.open(<em>method</em>, <em>url</em>, true); +xmlhttp.open(method, url, true); xmlhttp.onload = function () { // Do something with the retrieved data ( found in xmlhttp.response ) }; xmlhttp.send(); -</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', '#handler-xhr-onload')}}</td> - <td>{{Spec2('XMLHttpRequest')}}</td> - <td>WHATWG living standard</td> - </tr> - </tbody> -</table> +``` -<h2 id="Browser_compatibility">Browser compatibility</h2> +## Specifications +| Specification | Status | Comment | +| ------------------------------------------------------------------------ | ------------------------------------ | ---------------------- | +| {{SpecName('XMLHttpRequest', '#handler-xhr-onload')}} | {{Spec2('XMLHttpRequest')}} | WHATWG living standard | +## Browser compatibility -<p>{{Compat("api.XMLHttpRequestEventTarget.onload")}}</p> +{{Compat("api.XMLHttpRequestEventTarget.onload")}} |