谁会JS 帮个忙 <img src ="....." onerror="javascript:this.src='images/error.jpg';"/> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我的意思不用在 每一个IMG SRC 中都写 用一个JS 实现所有的功能 多个时可以这样!L@_@K<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title> new document </title> <meta name="generator" content="editplus" /> <meta name="author" content="Gao YiXiang" /> <meta name="email" content="[email protected]" /> <meta name="keywords" content="javascript dhtml dom" /> <meta name="description" content="I love web development." /></head><body> <img src="http://www.csdn.net/Images/logo_csdn.111" /> <img src="http://www.csdn.net/Images/logo_csdn.222" /> <img src="http://www.csdn.net/Images/logo_csdn.333" /> <script type="text/javascript"> <!--var oImgs = document.getElementsByTagName("img");for (var i=0; i<oImgs.length; i++){ oImgs[i].onerror = function() { this.src='http://www.csdn.net/Images/logo_csdn.gif'; };} //--> </script></body></html> function init(){ var errorImgUrl = 'images/error.jpg'; var imgs= document.getElementsByTagName("img"); for(var i=0;i<imgs.length;i++) { imgs[i].onerror = function() { this.src=errorImgUrl; } }}html body标签中添加 <body onload='init()'> <yourHtmlCode> </yourHtmlCode></body> ext2.0分页问题? 用execCommand后 对一个xml节的值 如何动态html标识增加事件 求助啊:javascript动态增加删除列表时,无法得到要传递的列表值? 拖动的层被拦截的问题 jquery 调用某个Id的div里的iframe?怎么弄? 为何 <body onload="window.open('test1.htm','title....)>为什么不能弹开一个页面 求救!请各位高手多多指教 还是关于正则表达式的问题,急! 请看看这个htm文件写法怎么总是提示有错误那? 怎样用脚本控制另外一个窗口的对象的属性?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<img src="http://www.csdn.net/Images/logo_csdn.111" />
<img src="http://www.csdn.net/Images/logo_csdn.222" />
<img src="http://www.csdn.net/Images/logo_csdn.333" />
<script type="text/javascript">
<!--
var oImgs = document.getElementsByTagName("img");
for (var i=0; i<oImgs.length; i++)
{
oImgs[i].onerror = function()
{
this.src='http://www.csdn.net/Images/logo_csdn.gif';
};
}
//-->
</script>
</body>
</html>
{
var errorImgUrl = 'images/error.jpg';
var imgs= document.getElementsByTagName("img");
for(var i=0;i<imgs.length;i++)
{
imgs[i].onerror = function()
{
this.src=errorImgUrl;
}
}
}html body标签中添加
<body onload='init()'>
<yourHtmlCode>
</yourHtmlCode>
</body>