We can use onload to determine the loaded JS object (js.onload). This method is well supported by Firefox2, Firefox3, Safari3.1, and Opera9.6 browsers, but it is not supported by IE6 and IE7. Curve to save the country - IE6, IE7 We can use js.onreadystatechange to track each state change (generally loading, loaded, interactive, complete). When the return status is loaded or complete, it means that the loading is completed and the callback function is returned. .
A supplementary explanation is needed for the readyState state:
1. In the interactive state, users can participate in interactions.
2. Opera actually supports js.onreadystatechange, but its state is very different from that of IE.
The specific implementation code is as follows: