onabort
            收藏:0  
            阅读:42
        
        
        Image onabort 事件
定义和用法
onabort 事件会在图像加载被中断时发生。
语法
		onabort="JavaScriptCode"
	
| 参数 | 描述 | 
|---|---|
| JavaScriptCode | 必需。规定该事件发生时执行的 JavaScript。 | 
浏览器支持
	![]()
![]()
![]()
![]()
 
所有主要浏览器都支持 onabort 事件
实例
在本例中,如果图像的加载被中断,则会显示一个对话框:
		<html>
<head>
<script>
function abortImage()
{
alert(‘Error: Loading of the image was aborted!‘)
}
</script>
</head>
<body>
<img src="image_w3default.gif" onabort="abortImage()">
</body>
</html>
<head>
<script>
function abortImage()
{
alert(‘Error: Loading of the image was aborted!‘)
}
</script>
</head>
<body>
<img src="image_w3default.gif" onabort="abortImage()">
</body>
</html>