機能の負荷(URL){ imgObjましょう = 新しい)(画像を。// 创建图片对象 imgObj.src = URL; もし(imgObj.complete){ にconsole.log( 'ロードされる' ) } 他{ imgObj.onload =()=> { にconsole.log( 'ローディング成功' ) }。 imgObj.onerror =()=> { にconsole.log( 'ローディングエラー' ) } } }
機能の負荷(URL){ imgObjましょう = 新しい)(画像を。// 创建图片对象 imgObj.src = URL; もし(imgObj.complete){ にconsole.log( 'ロードされる' ) } 他{ imgObj.onload =()=> { にconsole.log( 'ローディング成功' ) }。 imgObj.onerror =()=> { にconsole.log( 'ローディングエラー' ) } } }