aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/xmlhttprequesteventtarget/onload
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/fr/web/api/xmlhttprequesteventtarget/onload
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/fr/web/api/xmlhttprequesteventtarget/onload')
-rw-r--r--files/fr/web/api/xmlhttprequesteventtarget/onload/index.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/files/fr/web/api/xmlhttprequesteventtarget/onload/index.html b/files/fr/web/api/xmlhttprequesteventtarget/onload/index.html
new file mode 100644
index 0000000000..33c90dabc2
--- /dev/null
+++ b/files/fr/web/api/xmlhttprequesteventtarget/onload/index.html
@@ -0,0 +1,56 @@
+---
+title: XMLHttpRequestEventTarget.onload
+slug: Web/API/XMLHttpRequestEventTarget/onload
+translation_of: Web/API/XMLHttpRequestEventTarget/onload
+---
+<p> </p>
+
+<div>{{APIRef("XMLHttpRequest")}}</div>
+
+<p>The <strong><code>XMLHttpRequestEventTarget.onload</code></strong> is the function called when an {{domxref("XMLHttpRequest")}} transaction completes successfully.</p>
+
+<h2 id="Syntax" name="Syntax">Syntax</h2>
+
+<pre class="syntaxbox notranslate"><em>XMLHttpRequest</em>.onload = <em>callback</em>;</pre>
+
+<h3 id="Values">Values</h3>
+
+<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>
+
+<h2 id="Example" name="Example">Example</h2>
+
+<pre class="brush: js notranslate">var xmlhttp = new XMLHttpRequest(),
+ method = 'GET',
+ url = 'https://developer.mozilla.org/';
+
+xmlhttp.open(<em>method</em>, <em>url</em>, 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>
+
+
+
+<p>{{Compat("api.XMLHttpRequestEventTarget.onload")}}</p>