Pop-up window:
Alret ("What to Eject"); Don't make sure the page doesn't go down after it pops up.
Confirm ("What to Eject"); OK dialog box, click OK to return True, point cancel returns false, available variables accept
Prompt ("Hint text to display"); pops up a dialog box that allows you to enter content
Prompt ("Lose a number come in", "can only be a number");
Basic syntax
Basically consistent with C # syntax
break; jump out of the current loop
Continue; skip this cycle
Type conversions
var a=parseint (value), other types converted to integers
var a=parsefloat (value), other types converted to integers
IsNaN (value); Determines whether a valid number is returned true is not a return false
<script> var A; Prompt (" lose a number come in "" can only be a number oh "); = IsNaN (); // put the input into isNaN () alert (a); // if it is a numeric bullet true, it is not a digital bomb false</script>
Four forms of the function (no specified type)
No parameter no return value
test1 (); function Test1 () { alert ('hello'); }
No parameter has return value
There are no return values for parameters
<script> test1 (5,6); function Test1 (A, b) { alert ('a+b'); } </script>
There are parameters with return values
<script> var ccc = test1 (56); Alert (CCC); function Test1 (A, b) { var c = a + b; return c; } </script>
JS Review Basic grammar