当指定的图片不存在时用,默认图替换该图片
'SCRIPT>
var sImg=’
function fnLoadFirst(){
oContainer.innerHTML=sImg;
oStub.onerror=fnLoadFail1;
oStub.src=”" mce_src=”";
oStub.style.display=”block”;
}
function fnLoadFail1(){
oStub.alt=”Image failed to load.”;
return true;
}
'/SCRIPT>
'INPUT TYPE=button VALUE=”Load First Image” onclick=”fnLoadFirst()”>
'DIV ID=oContainer>'/DIV>
参考以上代码,实际上只要在客户端定义
imgID.onerror = “imgID.src=’出错图片.gif’”