Learn JavaScript notes from the beginning (i)--basics

Source: Internet
Author: User

Summary: The composition of JavaScript, the role of each component,

First, the composition of JavaScript

Javascript
ECMAScript (CORE) DOM (Document Object model) BOM (Browser object model)


1.1ECMAScript

ECMAScript is a standardized scripting language through ECMA-262, ECMA-262 language: syntax, type, statement, keyword, reserved word, operator, object

1.2 DOM

The DOM maps the entire page to a multi-tiered node structure, and each component of the page, such as HTML or XML, is a node of a certain type, and these nodes contain different types of data.

1.3 BOM

Controls the part of the browser that is displayed outside the page

Second, <script> elements

2.1 How to use

Externally referencing JavaScript files:

    

<script type= "Text/javascript" src= ". /.. /xx.js "></script>
View Code

 Page embedding JavaScript code

<script type= "Text/javascript" >    var first= "First variable";    alert (firstly);</script>

2.2 Properties of the <script> element

Defer delay script: The script will be deferred until the entire page is parsed before execution, although it is deferred execution, but the browser has downloaded the JS file.

<! DOCTYPE html>

In the above example, although the <script> tag is within the

Defer only applies to externally introduced script files

Async Async Script: Instead of having the page wait for the script to be downloaded and executed, the page can load other content asynchronously. Therefore, the asynchronous load script does not modify the DOM during the load.

<! DOCTYPE html>

Learn JavaScript notes from the beginning (i)--basics

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.