onabort Event

Definition and Usage

The onabort event occurs when the loading of audio/video is aborted.

This event occurs when media data download is aborted, not due to an error.

Tip:Events related to interference in the media loading process are:

Example

Execute JavaScript when the video loading is aborted:

<video onabort="myFunction()">

Syntax

In HTML:

<element onabort="myScript">

In JavaScript:

object.onabort = function(){myScript};

In JavaScript, use the addEventListener() method:

object.addEventListener("abort", myScript);

Note:Internet Explorer 8 or earlier versions do not support addEventListener() Method.

Technical Details

Bubbling: Not Supported
Cancelable: Not Supported
Event Type: If generated from the user interfaceUiEvent. Otherwise Event.
Supported HTML Tags: <audio> and <video>
DOM Version: Level 3 Events

Browser Support

The numbers in the table indicate the first browser version that fully supports the event.

Events Chrome IE Firefox Safari Opera
onabort Support 9.0 Support Support Support

Note:Internet Explorer 11 on Windows 7 does not support the onabort event.