<html>
<body>
<img src="image.gif"
onerror="alert('The image could not be loaded.')">
<p>在本例中,我们引用的图片不存在,所以弹出一个提示框。</p>
</body>
</html>