Image onabort event
Definition and Usage
onabort event occurs in the image loading is interrupted.
grammar
onabort="JavaScriptCode"
参数 | 描述 |
---|---|
JavaScriptCode | 必需。规定该事件发生时执行的 JavaScript。 |
Browser Support
All major browsers support onabort event
Examples
In this example, if the image load is interrupted, a dialog box appears:
<html> <meta charset="utf-8"> <title>本教程(w3big.com)</title> <script> function abortImage() { alert('Error: 图像加载终止!') } </script> </head> <body> <img src="image_w3default.gif" onabort="abortImage()"> </body> </html>
Image Object