Posted in Javascript onFebruary 02, 2007
<html>
<body>
<IMG src="http://www.google.com/logos/Logo_25wht.gif" alt="图片来源正常"></p>
<IMG src="abc.gif">
</body>
</html>
<script language="javascript">
var AllImages=document.getElementsByTagName("IMG");
for(i=0;i<AllImages.length;i++)
{
var img=AllImages[i];
img.onerror=function()
{
this.src="http://www.yaosansi.com/blog/logo.gif";
this.alt="图片来源错误";
}
}
</script>
如何判断图片地址是否失效
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@