Home >Web Front-end >JS Tutorial >JavaScript study notes (1) Using JavaScript in HTML_Basic knowledge

JavaScript study notes (1) Using JavaScript in HTML_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 17:52:38963browse

1. Methods to delay script running:
Method 1: Place all javascript references in the element, after the page content, such as

Copy the code The code is as follows:



Example 1
< /head>






Method 2: Define the defer attribute defer="defer" for the <script> element, such as <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="77320" class="copybut" id="copybut77320" onclick="doCopy('code77320')"><u>Copy the code </u></a></span> The code is as follows :</div> <div class="codebody" id="code77320"> <br><html> <br><head> <br><title>Example 1</title> <br><script type="text/javascript" defer=" defer" src="example1.js"></script>






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
Previous article:JavaScript Study Notes (11) Introduction to Regular Expressions_Basic KnowledgeNext article:JavaScript Study Notes (11) Introduction to Regular Expressions_Basic Knowledge

Related articles

See more