//判断链接是否存在 function validateImage(pathImg) { var ImgObj = new Image(); ImgObj.src = pathImg; if(ImgObj.fileSize > 0 || (ImgObj.width > 0 && ImgObj.height > 0)) { return true; } else { return false; } }