If I load multiple images with the for loop, do I only need one img.onload function?
问题 So I am loading multiple images onto multiple canvases basically (one image per canvas/ctx - its a slideshow). I want to make sure that each image is loaded before it attempts to draw the image onto the canvas. Here is the code... In Example 1 i'm using 3 onload events (one for each image) In Example 2 i'm using one onload event, but it is the last image that gets called in the for loop Question: Can i use Example 2 and be confident to assume that if the last image is loaded, then the images