diff options
author | julieng <julien.gattelier@gmail.com> | 2021-10-02 17:20:14 +0200 |
---|---|---|
committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-10-02 17:30:20 +0200 |
commit | c05efa8d7ae464235cf83d7c0956e42dc6974103 (patch) | |
tree | 6ea911b2f2010f63a026de6bb7a1a51e7690a7e1 /files/fr/web/api/xmlhttprequest/response/index.html | |
parent | 13a5e017558b248ee1647d4a5825f183b51f09ad (diff) | |
download | translated-content-c05efa8d7ae464235cf83d7c0956e42dc6974103.tar.gz translated-content-c05efa8d7ae464235cf83d7c0956e42dc6974103.tar.bz2 translated-content-c05efa8d7ae464235cf83d7c0956e42dc6974103.zip |
move *.html to *.md
Diffstat (limited to 'files/fr/web/api/xmlhttprequest/response/index.html')
-rw-r--r-- | files/fr/web/api/xmlhttprequest/response/index.html | 143 |
1 files changed, 0 insertions, 143 deletions
diff --git a/files/fr/web/api/xmlhttprequest/response/index.html b/files/fr/web/api/xmlhttprequest/response/index.html deleted file mode 100644 index afbad2c4f1..0000000000 --- a/files/fr/web/api/xmlhttprequest/response/index.html +++ /dev/null @@ -1,143 +0,0 @@ ---- -title: XMLHttpRequest.response -slug: Web/API/XMLHttpRequest/response -tags: - - AJAX - - Reference - - XMLHttpRequest -translation_of: Web/API/XMLHttpRequest/response ---- -<div>{{draft}}</div> - -<div>{{APIRef('XMLHttpRequest')}}</div> - -<div>La propriété <code>XMLHttpRequest.response</code> contient le corps de la réponse. Elle peut être de type ArrayBuffer, Blob, Document, un objet JavaScript ou une DOMString en fonction de la valeur de la propriété <code>XMLHttpRequest.responseType</code>. La réponse ( <code>Value of response</code> ) est nulle si la requête est incomplète ou n'as pas été effectué avec succès. Cependant, si <code>responseType</code> est "text" ou une chaine vide et tant que la requête est en cours ( dans l'état <em>loading</em> ), <code>response</code> peut contenir la réponse partielle.</div> - -<div> </div> - -<table class="standard-table"> - <tbody> - <tr> - <td class="header">Valeur de <code>responseType</code></td> - <td class="header">Type de donnée de la propriété <code>response</code></td> - </tr> - <tr> - <td><code>""</code></td> - <td>{{domxref("DOMString")}} (valeur par défaut)</td> - </tr> - <tr> - <td><code>"arraybuffer"</code></td> - <td>{{domxref("ArrayBuffer")}}</td> - </tr> - <tr> - <td><code>"blob"</code></td> - <td>{{domxref("Blob")}}</td> - </tr> - <tr> - <td><code>"document"</code></td> - <td>{{domxref("Document")}}</td> - </tr> - <tr> - <td><code>"json"</code></td> - <td> - <p>Objet JavaScript depuis une réponse JSON.</p> - </td> - </tr> - <tr> - <td><code>"text"</code></td> - <td>{{domxref("DOMString")}}</td> - </tr> - <tr> - <td><code>"moz-blob"</code> {{non-standard_inline}}</td> - <td> - <p>Used by Firefox to allow retrieving partial {{domxref("Blob")}} data from progress events. This lets your progress event handler start processing data while it's still being received. {{gecko_minversion_inline("12.0")}}</p> - </td> - </tr> - <tr> - <td><code>"moz-chunked-text"</code>{{non-standard_inline}}</td> - <td> - <p>Similar to <code>"text"</code>, but is streaming. This means that the value in <code>response</code> is only available during dispatch of the <code>"progress"</code> event and only contains the data received since the last <code>"progress"</code> event.</p> - - <p>When <code>response</code> is accessed during a <code>"progress"</code> event it contains a string with the data. Otherwise it returns <code>null</code>.</p> - - <p>This mode currently only works in Firefox. {{gecko_minversion_inline("9.0")}}</p> - </td> - </tr> - <tr> - <td><code>"moz-chunked-arraybuffer"</code>{{non-standard_inline}}</td> - <td> - <p>Similar to <code>"arraybuffer"</code>, but is streaming. This means that the value in <code>response</code> is only available during dispatch of the <code>"progress"</code> event and only contains the data received since the last <code>"progress"</code> event.</p> - - <p>When <code>response</code> is accessed during a <code>"progress"</code> event it contains a string with the data. Otherwise it returns <code>null</code>.</p> - - <p>This mode currently only works in Firefox. {{gecko_minversion_inline("9.0")}}</p> - </td> - </tr> - <tr> - <td>"ms-stream"{{non-standard_inline}}</td> - <td> - <p>Indique que la réponse est une partie d'un téléchargement d'un flux (?). Supporté uniquement pour les requêtes des téléchargements et disponible uniquement dans Internet Explorer.</p> - </td> - </tr> - </tbody> -</table> - -<div class="note"> -<p><strong>Note:</strong> À partir de Gecko 11.0 {{geckoRelease("11.0")}} et de WebKit build 528, ces navigateurs ne permettent plus l'utilisation de l'attribut <code>responseType</code> lors des requêtes synchrones. Cela renvoi l'erreur <code>NS_ERROR_DOM_INVALID_ACCESS_ERR</code>. Ce changement a été proposé au W3C afin d'être standardisé. </p> -</div> - -<h2 id="Example">Example</h2> - -<pre class="brush: js">var url = 'somePage.html'; // une page locale - -function load(url, callback) { - var xhr = new XMLHttpRequest(); - - xhr.onreadystatechange = function() { - if (xhr.readyState === 4) { - console.log(xhr.response); // Par défault une DOMString - } - } - - xhr.open('GET', url, true); - xhr.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', '#the-response-attribute')}}</td> - <td>{{Spec2('XMLHttpRequest')}}</td> - <td>WHATWG living standard</td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility">Compatibilité des navigateurs</h2> - -<div>{{Compat("api.XMLHttpRequest")}}</div> - -<h2 id="See_also">Voir aussi</h2> - -<ul> - <li>{{domxref("XMLSerializer")}} : Sérialisation d'un arbre DOM en XML</li> - <li>Tutoriels MDN couvrant le <code>XMLHttpRequest</code> : - <ul> - <li><a href="/fr/docs/Web/Guide/AJAX/Getting_Started">Ajax — Pour commencer</a></li> - <li><a href="/fr/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest">Utilisation de XMLHttpRequest</a></li> - <li><a href="/fr/docs/Web/API/XMLHttpRequest/HTML_in_XMLHttpRequest">HTML dans XMLHttpRequest</a></li> - <li><a href="/fr/docs/Web/API/Fetch_API">Fetch API</a></li> - </ul> - </li> - <li><a href="http://www.html5rocks.com/en/tutorials/file/xhr2/">HTML5 Rocks — New Tricks in XMLHttpRequest2</a></li> - <li>Directive Feature-Policy {{httpheader("Feature-Policy/sync-xhr", "sync-xhr")}}</li> -</ul> |