From 4873c5f1122ac800cf3c916a52df07e05ddc9dcf Mon Sep 17 00:00:00 2001 From: MDN Date: Fri, 11 Feb 2022 00:58:37 +0000 Subject: [CRON] sync translated content --- .../fr/web/api/xmlhttprequest/load_event/index.md | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 files/fr/web/api/xmlhttprequest/load_event/index.md (limited to 'files/fr/web/api/xmlhttprequest/load_event') diff --git a/files/fr/web/api/xmlhttprequest/load_event/index.md b/files/fr/web/api/xmlhttprequest/load_event/index.md new file mode 100644 index 0000000000..8d314127c3 --- /dev/null +++ b/files/fr/web/api/xmlhttprequest/load_event/index.md @@ -0,0 +1,41 @@ +--- +title: XMLHttpRequestEventTarget.onload +slug: Web/API/XMLHttpRequest/load_event +translation_of: Web/API/XMLHttpRequestEventTarget/onload +original_slug: Web/API/XMLHttpRequestEventTarget/onload +--- +{{APIRef("XMLHttpRequest")}} + +The **`XMLHttpRequestEventTarget.onload`** is the function called when an {{domxref("XMLHttpRequest")}} transaction completes successfully. + +## Syntax + + XMLHttpRequest.onload = callback; + +### Values + +- `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. + +## Example + +```js +var xmlhttp = new XMLHttpRequest(), + method = 'GET', + url = 'https://developer.mozilla.org/'; + +xmlhttp.open(method, url, true); +xmlhttp.onload = function () { + // Do something with the retrieved data ( found in xmlhttp.response ) +}; +xmlhttp.send(); +``` + +## Specifications + +| Specification | Status | Comment | +| ------------------------------------------------------------------------ | ------------------------------------ | ---------------------- | +| {{SpecName('XMLHttpRequest', '#handler-xhr-onload')}} | {{Spec2('XMLHttpRequest')}} | WHATWG living standard | + +## Browser compatibility + +{{Compat("api.XMLHttpRequestEventTarget.onload")}} -- cgit v1.2.3-54-g00ecf