Window onload and IMG onload events
Typically, Window.onload is executed after the DOM is loaded. IMG is the onload event that finishes loading the image and executes it, depending on whether the IMG SRC is loaded.
So, look at the following code:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Note: The top 6.png itself to find the picture to replace on.
The above code will not pop up 1 because window.onload already includes the onload of the picture, andthe onload of the picture is whether the src of the monitor img is loaded complete。 Remove the comment can pop up 1, not eject 1 of the possibility that your picture cannot be found, SCR did not load complete, so there is no popup 1.
PS:IMG onload events can also be used flexibly, such as some special business needs, can not append window.onload events, and consider using IMG onload event, such as loading a small picture, do hidden processing, inside call onload event.