What can JavaScript do?
It can directly respond to user or customer input, do static page interaction!
Do some website special effects function!
What is JavaScript?
JavaScript is a literal-translation scripting language, which is a dynamic type, a weak type, a prototype-based language, and a built-in support type.
How do I apply JavaScript to a Web page?
Internal type
<script type= "Text/javascript" >
var name= "Zhang San";
</script>
Embedded
<script src= "Js/special.js" type= "Text/javascript" charset= "Utf-8" ></script>
JavaScript-Syntax
Named
<br> integers: Consists of a sign, a number, an octal, a decimal, a hexadecimal; <br> floating-point number: By the sign, the number and the decimal point, the general method of counting, scientific notation; <br> logical value: True, False <br> String value: Single quotation mark, double quotation mark <br> null value: null <br> undefined value: An object that does not exist at all, a quantity that has been defined but not assigned a value; <br> <br> <script language= "Java Script "> var stdId; var total=3721; var notnull=true; var name= "Bruce Lee", sex= "Mr."; var i=j=0; var hobby=["Listen to Music", "See the film"]; Hobby[2]= "123"; var test; StdId = 2004007; document.write ("Variable stdid=" +stdid+ "<br>"); document.write ("Variable i=" +i+ "<br>"); document.write ("Variable j=" +j+ "<br>"); document.write ("Variable name=" +name+ "<br>"); document.write ("Variable sex=" +sex+ "<br>"); document.write ("Variable notnull=" +notnull+ "<br>"); document.write ("Variable hobby=" +hobby+ "<br>"); document.write ("Variable hobby[0]=" +hobby[0]+ "<br>"); document.write ("Variable hobby[1]=" +hobby[1]+ "<br>"); document.write ("Variable hobby[2]=" +hobby[2]+ "<br>"); document.write ("Variable hobby[3]=" +hobby[3]+ "<br>"); document.write ("Unassigned variable test=" +test+ "<br> "); document.write ("Non-existent value (0.0/0.0) =" + (0.0/0.0) + "<br>"); var t1=1.7976931348623157e+10308 document.write ("Positive value out of range" +t1) document.write ("<br/>") var t2=-1.79769313486 23157E+10308 document.write ("negative value out of range" +t2) </script>
Comment Statement
- Single-line Comment
- /*
- Multi-line comments
- */
Javascript--1