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)!