JS怎么控制一次加载一张图片,加载完后再加载下一张

(1)方法1

<script type="text/javascript">
    let obj = new Image();
    obj.src = "http://218.106.254.125:9999/OTA/110131B1240920210712-2bb310dc6f8854bacab22fbfda8cc1172.jpg";
    obj.onload = function() {
        alert('图片的宽度为:' + obj.width + '; 图片的高度为:' + obj.height);
        document.getElementById("myPic").innerHTML = "<img src='" + this.src + "' />"
    }
</script>
<div id="myPic">onloading……</div>