aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/xmlhttprequest/abort/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/pt-br/web/api/xmlhttprequest/abort/index.html')
-rw-r--r--files/pt-br/web/api/xmlhttprequest/abort/index.html118
1 files changed, 118 insertions, 0 deletions
diff --git a/files/pt-br/web/api/xmlhttprequest/abort/index.html b/files/pt-br/web/api/xmlhttprequest/abort/index.html
new file mode 100644
index 0000000000..52c1a52068
--- /dev/null
+++ b/files/pt-br/web/api/xmlhttprequest/abort/index.html
@@ -0,0 +1,118 @@
+---
+title: XMLHttpRequest.abort()
+slug: Web/API/XMLHttpRequest/abort
+tags:
+ - AJAX
+ - API
+ - HTTP
+ - HttpRequest
+ - Referencia
+ - XMLHttpRequest
+ - cancelando
+translation_of: Web/API/XMLHttpRequest/abort
+---
+<p>{{APIRef('XMLHttpRequest')}}</p>
+
+<p>O método <strong>XMLHttpRequest.abort()</strong> aborta a requisição se ela já tiver sido enviada. Quando uma requisição é abortada, o seu readyState é modificado para 0 (Desativado), mas o evento <a href="/pt-BR/docs/Web/Events/readystatechange">readystatechange</a> não é disparado.</p>
+
+<h2 id="Sitaxe">Sitaxe</h2>
+
+<pre class="syntaxbox">xhrInstance.abort();</pre>
+
+<h3 id="Parâmetros">Parâmetros</h3>
+
+<p>Nenhum.</p>
+
+<h3 id="Retorno">Retorno</h3>
+
+<p>Nenhum.</p>
+
+<h2 id="Exemplo">Exemplo</h2>
+
+<pre class="brush: js">var xhr = new XMLHttpRequest(),
+ method = "GET",
+ url = "https://developer.mozilla.org/";
+xhr.open(method,url,true);
+
+xhr.send();
+
+xhr.abort();
+</pre>
+
+<h2 id="Especificações">Especificações</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificação</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comentário</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('XMLHttpRequest', '#the-abort()-method')}}</td>
+ <td>{{Spec2('XMLHttpRequest')}}</td>
+ <td>WHATWG living standard</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidade_entre_navegadores">Compatibilidade entre navegadores</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(1)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatIe('5')}}<sup>[1]</sup><br>
+ {{CompatIe('7')}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatSafari('1.2')}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>1.0</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<p>[1] Esse recurso foi implementado através de ActiveXObject (). O Internet Explorer implementa o padrão XMLHttpRequest desde a versão 7.</p>
+
+<h2 id="Veja_também">Veja também</h2>
+
+<ul>
+ <li><a href="/pt-BR/docs/Web/API/XMLHttpRequest/Usando_XMLHttpRequest">Usando o XMLHttpRequest</a></li>
+</ul>