JavaScript zero-based introductory tutorial

(A) front-end development Three Musketeers: html css javascript

html: layer structure from the semantic structure description page angle.

css: Presentation Layer aesthetically beautify the page.

JavaScript: From the point of view of the interaction to enhance the user experience.

Today started learning JavaScript, to first understand javascript consists of three parts, namely ECMAScript, DOM, BOM three parts.

ECMAScript: the core includes grammar rules api, etc.

DOM: Document Object Model

BOM: browser object model.

Speaking of the browser will have to say about our current top five browsers Firefox (Firefox), Google Allo (Google), IE, opera (European friends), Safari (Apple). Like what browser 360, qq browser, uc browser, etc. These are based on the use of all five major browser kernel under these five browsers, like there is a big open e Burnaby 360 browser ie kernel it is based is used in the IE.

javascript is a weakly typed language, before declaring variables, there is no data types, once assigned, there will be a variable data types.

Inserting javascript code required in html script tag.

Before learning a language, to learn its grammar rules and development environment,

javascript development environment:

1. Editor: Editplus, Notepaad ++, sublime, notepad

2.IDE: Dreamweaver, Hbuilder, webstrom, indelij

JavaScript syntax rules;

1. Statement +; to be in English; to the end), each statement is js command "a" to the browser.

2.js Code must be case-sensitive.

3. Remember, all of the special symbols are in English half-angle.

4. In environments js code line feeds, spaces, indent insensitive.

5. Comment: // line comment; / * * / documentation comment.

6.js can appear anywhere on the html page.

(B) the amount of direct and variables

Direct amount: also known as literal, the contents can be used directly, there are two common: numeric, string.

(1) Value: 1,2,3,4,5,1.1,1.3, 1, -3, etc.

(2) the string: in the process is single or double quotation marks are wrapped string "hello" 'hello'

(3) 其它字面量:true、false、null、正则表达式。

Basis statement: alert ( 'hello world');

        alert('hi'); 

        在网页中弹出一个警告框,内容为hi

Variables: amount of change of the data stored in the memory for storing data

(1) the definition of variables (declared variable)

     var  变量名       var   关键字

(2) variable naming conventions

  1.区分大小写

  2.变量名必须以字母、下划线、或$ 开头

    变量组成以 字母、下划线、$ 或 数字 开头

    {不可使用关键字和保留字}

Keywords:
Here Insert Picture Description
reserved words:
Here Insert Picture Description
3. variable assignment;

      变量名=值

 4.取出变量的值:使用变量名;

 5.变量可以重复赋值,但是不要重复赋值,一旦再次赋值,上次的赋值就没有任何意义了;

(Iii) Data Type

1. Numerical number: Digital

2. String: string contents are single or double quotes packet "hello" '123';

3. Boolean boolean: true, false;

4. Other types of data: undefined (undefined), null (empty), Object (object type, reference type)

(Iv) Other data type (raw data type)

   number、boolean、string、undefind、null
Published 142 original articles · won praise 43 · views 10000 +

Guess you like

Origin blog.csdn.net/cool99781/article/details/104503095