[Javascript] Javascript notes

1, October 20, 2019 12:28:16 learn HOW2J of Javascript,

2, seen in general abbreviation js, javascript is meant;

3, javascript code must be placed in the script tag, script html tag can be placed anywhere, and general advice on the head tag.

4, what is the code for a script?

       Occur once <script>

                       .......

                     </ Script> script section of code is called;

5, using an external js file

      When too much of the HTML script code that time, it seems very complicated, you can put the javascript code stripped out, written in a code file, and then call the code files in the main code HTML,

      For example, he wrote a hello.js documents, content, document.write ( "hello javascript"); 

      Then write the HTML code like this:

<html>
  <script src="http://how2j.cn/study/hello.js"></script>
</html>

6, javacsript variable naming rules

         _ $ And can be used at the beginning of the letter, referred to under US parent

7, the string

     The difference is that the java, javascript no concept of character strings only, the single and double quotation marks are used to represent the string;

8, converted into digital

      javascript built-in functions are provided the parseInt () and parseFloat (), are converted into digital;

9, converted to Bollean

      Boolean function using the built-in () is converted to a Boolean value,

 

Guess you like

Origin www.cnblogs.com/zf007/p/11707276.html