Home  >  Article  >  Web Front-end  >  Usage example of onabort event of Event object in html DOM_javascript skills

Usage example of onabort event of Event object in html DOM_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:18:51947browse

The example in this article describes the usage of the onabort event of the Event object in the DOM of html. Share it with everyone for your reference. The specific analysis is as follows:

The onabort event occurs when image loading is interrupted.

This handler is called when the user abandons loading of the image (such as clicking the stop button) before the image has finished loading.

Syntax:

Copy code The code is as follows:
onabort="SomeJavaScriptCode"

SomeJavaScriptCode required. Specifies the JavaScript to be executed when this event occurs.

HTML tags that support this event:

JavaScript objects that support this event:
image

In this example, if the loading of the image is interrupted, a dialog box will be displayed:

Copy code The code is as follows:

Example: If loading of an image is interrupted, call a function:
Copy code The code is as follows:





I hope this article will be helpful to everyone’s JavaScript programming design.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn