Usually our website will load some js code, such as statistics, Google ads, Baidu Alliance, Alimama advertising code, etc., and finally the page loading speed will be very slow.
Solution: Change A js inclusion method doubles the loading speed of javascript.
Replace the usual loading method:
Change to:
If you want to load multiple js, you can use the following method
Other js follow the same pattern, for advertising and page special effects. . .
A few more nonsense words at the end:
Use
<>
, you can also load the JS file you want on demand and conditionally:
<>
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