js中判断图片存不存在

function checkImage(path){
    var img = $(“<img src=’”+path+”’>”);
    if(img[0].height > 0 && img[0].weight > 0){
        return true;
    }else{
        return false;
    }
}    
posted @ 2019-11-27 16:27  谭浩1410  阅读(406)  评论(0)    收藏  举报