js learning summary

Under a simple summary of it: not many actually do things because not many things to learn, mainly to learn some basic js of usage, input and output, statement syntax, annotation objects string array variable operators and logical operators character, function and application events objects.

Introduction: a brief look, in fact, he is a web-scripting language he was mainly responsible for the web page to click to do some scripting language such a call, but this scripting language or a good use.

Today is the first study of the first module scripting language is to click a button to do something, the first point is to write js code in the HTML tags that inside, some of the code in html head inside the head or body inside. In different places have different roles.

The second point is: too many long-winded front label do not write, and write some of the major labels it notes, annotations cases are those comments, how-line comments have single-line comments, // a single line, / * * / multi-line comments.

The third point: this is very important because the variable variable in any language will be involved in something, so it is important, what is equivalent to the assignment, a = 3; basically like this.

The fourth point: data types: numeric, string values, arrays, objects, and so on: in fact, with these Java language is almost the same, so the data type or focus.

Fifth: the array is used to store a plurality of data values, the data is also very important.

In fact, today there is a small program does not write the multiplication table is how to write a 9 * 9: Code

 

1  <script type="text/javascript">
2                function step(){
3                for(i=1;i<=9;i++){
4                         for(j=1;j<=i;j++){
5                                 document.write(i+"x"+j+"="+i*j+" ")
6                         }document.write(<br/>)
7                }
8                }
9        </script>

 

Guess you like

Origin www.cnblogs.com/qijiang123/p/11450581.html