首页
HTML / CSS
XML技术
Java技术
脚本语言
前端技术
框架
数据库
高级语言
软件测试
开发工具
大数据
其他技术
JavaScript 参考手册
概览
JavaScript
对象
JavaScript Array 对象
JavaScript Boolean 对象
JavaScript Date 对象
JavaScript Math 对象
JavaScript Number 对象
JavaScript String 对象
JavaScript RegExp 对象
JavaScript 全局属性/函数
JavaScript 运算符
JavaScript Error
Browser
对象
Window 对象
Navigator 对象
Screen 对象
History 对象
Location 对象
存储对象
DOM
对象
HTML DOM Document 对象
HTML DOM 元素对象
HTML DOM 属性对象
HTML DOM 事件对象
HTML DOM Console 对象
CSSStyleDeclaration 对象
DOM HTMLCollection
HTML
对象
<a>
<area>
<audio>
<base>
<blockquote>
<body>
<button>
<canvas>
<col>
<colgroup>
<datalist>
<del>
<details>
<dialog>
<embed>
<fieldset>
<form>
<iframe>
<frameset >
<img>
<ins>
<input> - button
<input> - checkbox
<input> - color
<input> - date
<input> - datetime
<input> - datetime-local
<input> - email
<input> - file
<input> - hidden
<input> - image
<input> - month
<input> - number
<input> - range
<input> - password
<input> - radio
<input> - reset
<input> - search
<input> - submit
<input> - text
<input> - time
<input> - url
<input> - week
<keygen>
<link>
<label>
<legend>
<li>
<map>
<menu>
<menuItem>
<meta>
<meter>
<object>
<ol>
<optgroup>
<option>
<param>
<progress>
<q>
<script>
<select>
<source>
<style>
<table>
<td>
<th>
<tr>
<textarea>
<title>
<time>
<track>
<video>
Image
onerror
事件
Image 对象
定义和用法
onerror 事件会在文档或图像加载过程中发生错误时被触发。
语法
onerror="
JavaScriptCode
"
参数
描述
JavaScriptCode
必需。规定该事件发生时执行的 JavaScript。
浏览器支持
所有主要浏览器都支持 onerror 事件
实例
实例
在本例中,如果装载图像时发生了错误,则显示一个对话框:
<img src="image.gif" onerror="alert('图片不能被加载。')">
Image 对象
上一篇
Image onload 事件
下一篇
Image onabort 事件