标签:创建 erro complete ons javascrip log 图片 span img
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‘) } } }
标签:创建 erro complete ons javascrip log 图片 span img
原文地址:https://www.cnblogs.com/223zzm/p/11666334.html