function load(url) { let imgObj = new Image(); // 创建图片对象 imgObj.src = url; if (imgObj.complete) { console.log(‘is loaded‘) } else { imgObj.onload = () => { console.log(‘loading success‘) }; imgObj.onerror = () => { console.log(‘loading error‘) } } }
原文地址:https://www.cnblogs.com/223zzm/p/11666334.html
时间: 2024-10-28 23:52:34