JS Introduction and use

Source: Internet
Author: User

JS is a scripting language that runs on a browser and is a scripting language that is applied to client Web development.

The core of JS is very concise and contains two parts: basic grammatical constructs (operators, control structures, statements) and standard libraries (objects with various functions such as array, Date, math, etc.)

The complete JS consists of three parts:

1, the core of JavaScript (ECMAScript)

2. Document Object Model (dom,document)

3. Browser object Model (BOM Browser object models)

Dom is part of the BOM

Dom-->document-->window

Bom-->window

JS Features: No compilation, interpreted by the JavaScript engine, is a weakly typed language, is Object-based.

JS three ways to quote:

1. In the HTML element event, execute the JS event:

<button onclick = "Console.log (' executed click event ')" > button </button>

2, using the script element, the general script tag placed in the head: The JS code directly placed in the script tag, JS code is executed sequentially;

<script type= "Text/javascript" >    console.log (' executed event 2 '); </script>

3, JS external reference script file, the introduction of an external JS file;

<script src= "Ej1.js" ></script>

JS Introduction and use

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.