let checkImgExists = function(url) { return new Promise(function(resolve, reject) { let ImgObj = new Image(); ImgObj.src = url; ImgObj.onload = function(res) { resolve(res); } ImgObj.onerror = function(err) { reject(err) } }) } checkImgExists('//www.baidu.com/img/flexible/l...