In the HTML position has three blocks: 1.head inside 2.body inside 3.
3 common dialog boxes
Alert () Warning dialog box, which is the function of a warning dialog to pop up.
Confirm () Determines the dialog box, the function is to pop up a selection of OK dialog box, after clicking OK, it returns True, click Cancel to return flase, available variables to accept.
The prompt () function pops up a dialog box that allows you to enter content.
JavaScript syntax
JavaScript: There is only one variable type, var. Data type: Integer, Decimal, String, Boolean
1. How to turn a numeric string into a digital type:
parseint ("string")--turns the string into an integral type
Parsefloat ("string")--turns the string into a decimal number
2. How can I tell if a variable is a number?
var a = IsNaN (b);
True is not a number
False is a number
Array new Array (); its length is dynamically variable, it can be placed in any type of element.
Sorted array: A.sort (); Sort by first character, A.reverse (); Flip Array.
Function
Define function functions Add (formal parameter) {function Body}, functions name Add, input as parameter, return value can be var type or return value.
Function not called does not execute, call of function: Add (argument)
DOM Operations
-blank is a new window open
-slef is its own window open
Introduction to JavaScript