In the daily work in the use of the native JS very little, feel that they have been the original JS forgotten, here to start summing up the next JS, from the basis of the beginning of it!!! The composition of javascript: 1, ECMAScript: Interpreter, translator. Personal understanding is the Analytic programming language. 2, Dom:document Object Model. Action page element 3, Bom:browser Object moder. Manipulate the data type of the browser javascript: JavaScript uses typeof to determine the data type. The data types returned with typeof have the following common undefined: 1, no declaration in two cases. 2, declared but not assigned. Number string Boolean function object instance:
<script> |
|
var a=12; |
|
|
|
Alert (typeof a); Number |
|
|
|
A= ' abc '; |
|
Alert (typeof a); String |
|
|
|
A=true; |
|
Alert (typeof a); Boolean Boolean |
|
|
|
/*window.onload=function () |
|
{ |
|
A=document.getelementbyid (' Div1 '); |
|
|
|
Alert (typeof a); Object |
|
};*/ |
|
|
|
A=function () |
|
{ |
|
Alert (' abc '); |
|
}; |
|
|
|
Alert (typeof a); function |
|
|
|
var b; |
|
Alert (typeof B); Undefined |
|
/* |
|
Undefined 1. You really don't have a definition. 2. Although defined, but not given a value |
|
*/ |
|
|
|
</script> |
Front-End JavaScript Basics Summary (1) JS composition and data type