第一种方式
0 || (ImgObj.width > 0 && ImgObj.height > 0)) {
alert(imgurl + '存在');
} else {
alert(imgurl + '不存在');
}
}
CheckImgExists('/editor/simple/FileIconDir/rar.gif');
CheckImgExists('/editor/simple/FileIconDir/rarsdfs.gif');
另外一种实现方式
代码如下:
第三种方式
调用此函数
function defaultImg(T)
{
T.src = "images/closelabel.gif";//默认图片地址
}
//载入成功后会调用此函数
function LoadOK()
{
alert("LoadOK");
}

以上所述就是本文的全部内容了,希望大家能够喜欢。