JavaScript Advanced Programming--01

Source: Internet
Author: User

Chapter Javasript Introduction to the first section

1. What is JavaScript?

An object-oriented, interpretive programming language.

Features of the 2.JavaScript.

    • Loose sex
    • Object Properties
    • Inheritance mechanism (prototype based)

3.JavaScript Core

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

Chapter II using JavaScript


1. Create an HTML page

<!DOCTYPE HTML><HTMLLang= "en"><Head><MetaCharSet= "Utf-8"/><title>The first page</title></Head><Body><H1>Hello World</H1></Body></HTML>

2.<script> Label parsing

    • Defer----Specifies whether to defer execution of the script until the page loads.
    • SRC----Specifies the URL of the external script file.
    • Type----Specifies the MIME type of the script.
    • CharSet----Defines the character encoding used in the script. Not supported.

Some problems with 3.JS code embedding

Smooth degradation, JavaScript not supported

< NoScript > You do not have JavaScript enabled. </ NoScript >

Chapter III syntax, keyword reserved words and variables

1. Grammatical composition

    • Case sensitive
    • Identifiers: Variables, functions, names of properties, or parameters of a function
    • Comments//Single Line/* * * Multiple lines
    • Direct volume (literal)
    • Expressions for array literals and object literals are also supported by {x:1,y:2},{1,2,3,4,5}

2. Keywords and reserved words

3. Variables

Fourth Chapter data types

Simple data types: Undefined,null,boolean,number and string

Complex data type: Object

1.typeof operator

    • objects or null----object
    • Functions------function (not data type)

2.Undefined type

    • There is only one value, that is, the special undefined
    • Declaring a variable with VAR, but not initializing it
    • It is not necessary to assign a variable to undefined

3.Null type

    • There is only one value, that is, the special null
    • It represents an empty object reference (pointer)
    • If you define variables to be used in the future to save objects, it is best to initialize
    • Undefined is derived from Null,alert (undefined==null)//true

4.Boolean type

A Boolean value of false for the following conditions

    • Empty string
    • 0 and Nan
    • Null
    • Undefined

5.Number type

Floating-point range

Number.min_value~~~number.max_value

    • Alert (IsNaN (NaN))---True
    • Alert (number (TRUE))---1
    • Alert (number (NULL))---0
    • Alert (number (undefined))----false

JavaScript Advanced Programming--01

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.