JavaScript Advanced Programming Learning Summary 1

Source: Internet
Author: User
Tags script tag blank page

1. A complete JavaScript implementation consists of three parts: the core (ECMAScript), the Document Object Model (DOM), and the browser object model (BOM), ECMAScript is the standard rules such as syntax, type, statement, keyword, reserved word, The description of the operator and the language of the object.

Document Object Model DOM

An application Programming interface (API) for XML but extended for HTML. Dom maps the entire page into a multi-tiered node structure that gives developers the initiative to control the page

Browser Object Model BOM

Provides methods and interfaces for interacting with the browser

2.script the location of the script tag is best placed in front of </body>, the user will be the browser window display blank page time to feel the speed of opening the page, assuming that in

The defer property of the script tag indicates that the scripts are deferred until the entire page is loaded and executed

The Asyn property of the script tag applies to external script files, and scripts marked as Asyn properties are not guaranteed to be executed in the specified order of precedence. The purpose of specifying the async attribute is to not allow the page to wait for two scripts to download and execute, thus asynchronously loading the rest of the page. It is recommended that asynchronous scripts do not modify the DOM during loading.

3. Grammar attention Points

Number conversion rule: If Boolean,true and false are converted to 1 and 0 respectively, if it is a numeric value, it is passed directly, if NULL, 0 is returned, and if it is undefined, a nan is returned;

If it is a string:

If the string contains only numbers, it is converted to a decimal value, which is ignored for the predecessor 0, such as "011" becomes 11

If the string contains a valid floating-point format, it is converted to the corresponding floating-point value (also ignored by the predecessor 0)

Converts a string to a decimal number of the same size if it contains a valid 16 binary format, such as "0xf"

If the string is empty, convert it to 0

Convert to Nan If the string contains characters other than the above format

If the object is:

The object's ValueOf method is called first, and then the returned value is converted according to the preceding rule. If the result of the conversion is Nan, the object's ToString method is called, and the returned string value is converted according to the preceding rule.

The parseint function is more commonly used when working with integers, and it is recommended to explicitly specify the cardinality to be converted, such as parseint ("10", 8);

ToString creates a character value by passing the cardinality, outputting binary, octal, and 16-binary representations.

Infinity * 0 = NaN

Infinity/infinity = NaN

infinity-infinity = 0

= = will cast a certain amount on the left and right side of the operand, then compare

JavaScript Advanced Programming Learning Summary 1

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.