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.