Example of onabort Event usage of Event object in html DOM, domonabort

Source: Internet
Author: User

Example of onabort Event usage of Event object in html DOM, domonabort

This article describes how to use the Event object onabort Event in the html DOM. Share it with you for your reference. The specific analysis is as follows:

The onabort event occurs when the image loading is interrupted.

This handle is called when you discard image loading before the image is loaded (for example, you click the stop button.

Syntax:
Copy codeThe Code is as follows: onabort = "sometriccriptcode"
Sometriccriptcode is required. Specifies the JavaScript code executed when the event occurs.

HTML tags that support this event:

JavaScript objects that support this event:
Image

In this example, if the image loading is interrupted, a dialog box is displayed:
Copy codeThe Code is as follows:
Example: If the image loading is interrupted, call a function:
Copy codeThe Code is as follows: <Head>
<Script type = "text/javascript">
Function abortImage ()
{
Alert ('error: Loading of the image was aborted ')
}
</Script>
</Head>

<Body>

</Body>

</Html>

I hope this article will help you design javascript programs.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.