Window onload and IMG onload events
Typically, Window.onload is run after the DOM is loaded.
and IMG is the OnLoad event that runs it when the picture is loaded. Based on whether 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. Since Window.onload already contains the onload of the picture. the onload of the image is the monitor of the IMG SRC is loaded complete . Remove the gaze can pop up 1, not pop 1 may not be able to find your picture. SCR is not loaded. So there is no popup 1.
The onload event of ps:img can also be used flexibly, like some special business requirements. Cannot append window.onload events, etc., and consider the onload event with IMG, such as loading a small picture and doing hidden processing. The onload event is called inside.
Window onload and IMG onload events