Home >Web Front-end >JS Tutorial ><script defer> What does defer mean_Basic knowledge
After the program is downloaded, it is parsed and executed.
The document says that the code in defer will not be executed immediately, and the page will continue to load. So when will the code in defer be executed? After all the javascript code is loaded? After the page loads? Before or after onload?
The answer is:
It does not mean that it will not be executed when the web page is loaded. You can write a SCRIPT on the web page and then define it, but it will still be executed when loading,
Later, when I was looking for other stuff, I found that because it didn’t have a subtitle, I didn’t know how to use it.
It turns out that after your webpage has been intercepted, you want to dynamically add a new one