Home  >  Article  >  Web Front-end  >  How to use innerhtml to improve page opening speed_javascript skills

How to use innerhtml to improve page opening speed_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:27:211530browse

Looking at the source code, you can find that there is only one line of login code at the top of the page

Copy code The code is as follows:

< /div>

And the position of the flash slideshow is only one line
Copy code The code is as follows:



For this kind of time-consuming code, it is best to place it at the end of the page Load, and then use the innerhtml method to load to the corresponding location to speed up page opening.
Copy code The code is as follows:

$("#headtop").html($( "#headtop2").html());
$("#index_slide").html($("#index_slide2").html());
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