onabort Event
Example
Execute a JavaScript if loading of an image is aborted:
<img src="image_w3default.gif" onabort="myFunction()">
Description
The onabort event occurs when the user aborts the loading of an <img> or <input type="image"> element.
Browser Support
Event | |||||
---|---|---|---|---|---|
onabort | Not supported | Yes | Not supported | Not supported | Not supported |
Syntax
In HTML:
<element
onabort="myScript">
In JavaScript:
object.onabort = function(){myScript};
In JavaScript, using the addEventListener() method:
object.addEventListener("abort", myScript);
Technical Details
Bubbles: | Yes |
---|---|
Cancelable: | No |
Event type: | UIEvent if generated from a user interface, Event otherwise. |
HTML tags: | <img> and <input type="image"> |
DOM Version: | Level 2 Events |
❮ Event Object