Small strong HTML5 Mobile Development Road (--javascript) Review 4

Source: Internet
Author: User
The scope of a variable

The execution of a JavaScript script is divided into two stages:

In the first phase, the JS engine () scans the entire JavaScript code first. When <script> is encountered, a global active object is created, and the Declaration of variables appearing in <script> and the definition of the function are saved in the active object. If a function is encountered, the corresponding local activity object is created, and the declaration of the variable inside the function and the definition of the function are saved inside the active object.

In the second stage, the JavaScript code is executed, the variables are encountered, and the active object is found in the corresponding activity object.


Math (a JavaScript built-in object that can be used directly)

Math.random (): Returns the random number from 0 to 1 0<= random number <1
Math.ceil (): Rounding up

Math.floor (): Rounding Down


Third, the system of the DOM model

1. What is DOM

Document Object Model

Transforms a structured document (XML, HTML) into a tree and provides properties or methods related to the operation of the tree (including traversal, find, modify, delete, etc.)

2. The basic structure of the DOM model

Nodedocumenthtmldocument  (

The above is Xiao Qiang's HTML5 Mobile Development Road (--javascript) Review 4 of the content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Related Article

    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.