[Basics of web front-end | Basics of JS] Getting to know javaScript

Getting to know javascript

  • Brendan Eich (Brendan Eich, 1961~). Completed in 1995 in 10 days
  • Script language running on the client, no need to compile
  • No need to configure the environment
    1
  • Function
    ① Form dynamic verification (password strength detection) (The original purpose of JS generation)
    ② Webpage special effects
    ③ Server-side development (Node.js)
    ④ Desktop program (Electron)
    ⑤ App (Cordova)
    ⑥ Control hardware-Internet of Things (Ruff)
    ⑦ Game development

2

One: Introduction to browser execution js

2

The browser itself does not execute JS code, but executes JS code through a built-in JavaScript engine (interpreter). When the JS engine executes the code, it interprets each source code line by line (converted into machine language), and then is executed by the computer, so the JavaScript language is classified as a scripting language and will be interpreted and executed line by line.

Two: the composition of js

3

  1. ECMAScript
    ECMAScript is a programming language standardized by ECMA International (formerly the European Computer Manufacturers Association). This language is widely used on the World Wide Web. It is often called JavaScript or JScript, but in fact the latter two are the ECMAScript language. Implementation and expansion.
  2. DOM-Document Object Model
    Document Object Model (DocumentObject Model, referred to as DOM) is a standard programming interface for processing extensible markup language recommended by the W3C organization. Various elements on the page (size, position, color, etc.) can be manipulated through the interface provided by the DOM
  3. BOM-- browser object model
    browser object model (Browser Object Model, referred BOM) refers to the browser object model that provides a structure independent of the content of the object, you can interact with the browser window. Through BOM, you can operate the browser window, such as pop-up box, control browser jump, obtain resolution, etc.

Three: js three writing methods

3.1: In-line formula

<!-- 行内式的js -->
<input type="button" value="点击" onclick="alert('点击干啥')">

3.2: Inner fitting type

<!-- 内嵌式 -->
<script>
    alert("弹出了个框框");
</script>

3.3: External js

<!-- 外部js -->
<script src="index.js"></script>

Four: js comments

1: Single line comment: // (shortcut key: ctrl+/)
2: Multi-line comment: /* */ (shortcut key: shift+alt+A)

Guess you like

Origin blog.csdn.net/qq_43490212/article/details/110083062