Python full stack development day44-js, DOM, BOM

Source: Internet
Author: User
Tags uppercase character

JS three parts of one, Ecmajavascript basic syntax: 1.javascript introduction 1) Inline

<script>

Alert (1)

</script>

2) Introduction Type

<script src= ' test.js ' > </script>

2.javascript Basic Syntax 1) a few simple functions

Alert (), # warning dialog box

Confirm (), # confirmation dialog box

Prompt (), # Input dialog box, received as a string

Config.log () # console output

Config.dir () #

document.write () #

typeof (variable) # type query

Syntax rules: JavaScript for line, indentation, space insensitive, end of statement with a semicolon, single-line comment//Multiline comment/*/

2) Direct volume, variable

(1) Direct Volume: Number 99 and string "99"

(2) Definition, assignment, naming specification of variables

var A;

A = 1;

· Naming conventions for variable names: only English letters, numbers, underscores, dollar sign $, and cannot start with a number, and cannot be a JavaScript reserved word. and case sensitive.

            Camel 标记法

The first letter is lowercase, and the next letter begins with an uppercase character.  For example:var mytestvalue = 0, Mysecondvalue = "Hi" = 0, Mysecondvalue = "Hi" = 0, Smysecondvalue = "HI";
variable name writing type

3) Data type base data type:

String:

Number:

Number.max_value,number.min_value.

Nan is not equal to Nan

IsNaN (' Test ') #true

Infinity

Boolean:

Null:

Undefined:

Reference data type:

Array: Arrays

String:

Date:

Object:

4) Data type conversion

        

        • Number + String : Number converted to string
        • Number + Boolean: True converts to 1,false to 0
        • String + Boolean value : Boolean converted to string true or False
        • Convert to String: toString ()
        • Convert to Number: parseint ()
        • Convert to Floating point: parsefloat ()
        • Coercion Type conversions: String (), Boolean (), Number ()
5) Process Control # if () {}else{} # if () {}else if () {}else{} # && | | # while () {} # Do{}while () # for (Var i=0;i<10;i++) {},

# switch (condition) {//Note case penetrating problem

Case 1:

Execute the statement;

Break

Case 2:

Execute the statement;

Break

。。。。。。。。

Default

Execute the statement;

}

                                             

Second, Dom three, BOM

Python full stack development day44-js, DOM, BOM

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.