Home  >  Article  >  Web Front-end  >  How to make the js_javascript trick execute after the page is loaded

How to make the js_javascript trick execute after the page is loaded

WBOY
WBOYOriginal
2016-05-16 17:31:031123browse

javascript is executed only after the page dom model is loaded. javascript
cannot be used
plus defer means it will be executed after the page is completely loaded, which is equivalent to window .onload, but more flexible than window.onload in application

Copy code The code is as follows:


< ;html xmlns=" http://www.w3.org/1999/xhtml">


Untitled Document



Read this paragraph first and then execute the above JS. If you remove the defer="defer" above, then JS will be executed first. After seeing this paragraph


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn