abort

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The abort event of the Fetch API is fired when a fetch request is aborted, i.e. using FetchController.abort().

Bubbles No
Cancelable No
Target objects FetchSignal
Interface Event

Examples

In the following snippet, we create a new AbortController object, and get its AbortSignal (available in the signal property). Later on we check whether or not it the signal has been aborted using the onabort property, and send an appropriate log to the console.

var controller = new AbortController();
var signal = controller.signal;

signal.onabort = function() {
  console.log('Request aborted');
};

Inheritance

The abort event implements the Event interface — it has available the properties and methods defined on this interface.

Specifications

Specification Status Comment
DOM
The definition of 'abort' in that specification.
Living Standard Initial definition

Browser compatibility

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support

?

? 57 (57) No support

?

No support
Feature Android Android Webview Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile Chrome for Android
Basic support No support ? ? 57.0 (57) No support ? No support ?

See also

Document Tags and Contributors

Tags: 
 Contributors to this page: chrisdavidmills
 Last updated by: chrisdavidmills,