Home >Web Front-end >JS Tutorial >Overview of JavaScript Learning Experience_Basic Knowledge

Overview of JavaScript Learning Experience_Basic Knowledge

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 16:19:121084browse

1. JavaScript is a scripting language designed specifically for interacting with web pages. Its composition

ECMAScript (Core) DOM (Document Object Model) BOM (Browser Object Model)

1.1ECMAScript

ECMAScrip defined by ECMA-262 has no dependency on web browsers. ECMA-262 only defines the basis of this language and provides core language functions

ECMAScript is a scripting language standardized through ECMA-262. ECMA-262 specifies the language: syntax, types, statements, keywords, reserved words, operators, objects

1.2 DOM (Document Object Modle)
DOM is an application programming interface (API, Application Programming Interface) for XML but extended for HTML, providing methods and interfaces for accessing and operating web content

DOM maps the entire page into a multi-layer node structure. Each component in a page such as HTML or XML is a certain type of node, and these nodes contain different types of data.

1.3 BOM(Bower Object Modle)
Control parts other than the page displayed by the browser. BOM only handles browser windows and frames, providing methods and interfaces for interacting with the browser

2. <script> element<br> 2.1 Quoting javascript files <br> External reference javascript file: </p> <p></p> <div class="codetitle"> <span><a style="CURSOR: pointer" data="81093" class="copybut" id="copybut81093" onclick="doCopy('code81093')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code81093"> <br> <script type="text/javascript" src="../../XX.js"></script>

The page embeds javascript code

Copy code The code is as follows:


JavaScript code contained within the <script> element will be interpreted from top to bottom</p> <p>2.2 Attributes of <script> element</p> <p>Defer delay script: Tell the browser to download immediately. The script will be delayed until the entire page is parsed before execution. Defer only applies to externally introduced script files</p> <p></p> <div class="codetitle"> <span><a style="CURSOR: pointer" data="50781" class="copybut" id="copybut50781" onclick="doCopy('code50781')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code50781"> <br> <!DOCTYPE html><br> <html><br> <head><br>              <script type="text/javascript" defer="defer" src="example.js"></script>


Although the <script> tag is located within the <head> tag, demo.js will be delayed until the browser encounters </html>. </p> <p>async asynchronous script: The page must wait for the download and execution of the script, thereby asynchronously loading other content on the page<br> Like defer, it only applies to externally introduced script files. async tells the browser to download the file immediately, but unlike defer, marked async scripts do not guarantee that they will be executed in the order in which they are specified. It is recommended that asynchronous scripts not modify the DOM during loading. </p> <p></p> <div class="codetitle"> <span><a style="CURSOR: pointer" data="90302" class="copybut" id="copybut90302" onclick="doCopy('code90302')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code90302"> <br> <!--Asynchronous script--><br> <script type="text/javascript" async="async" src="example1.js"></script>

2.3

Copy code The code is as follows:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
http://www.w3.org/1999/xhtml">


test







The browser does not support scripts

The browser supports scripts, but if scripts are disabled, the browser will display the content in

The above is the entire content of this article. I hope you all like it. This series will continue to be updated.

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:Summary of DIY handwritten jQuery plug-ins_jqueryNext article:Summary of DIY handwritten jQuery plug-ins_jquery

Related articles

See more