l JavaScript is case sensitive
For example, variable a and variable A are different variables and must be strictly case-sensitive
l JavaScript scripts must be embedded in HTML files
Because the javascript script program is introduced through the script tag, the script tag must be written in the HTML document and cannot be written separately.
l JavaScript scripts cannot contain HTML markup code
Examples of incorrect writing:
window.document.write('php');
Correct writing:
var str;
str ='
str +='php';
str += '';
window.document.write(str);
l Write one script statement per line
Easy for the browser to read, parse and execute each item one by one
l You can add a semicolon at the end of the statement. It must be the semicolon (;) in English. It is best to add a semicolon
l JavaScript script program can be saved independently as an external file
Advantages of externally imported js files:
1, Separate structure, style, behavior (js) code
2. Conducive to program maintenance3
, Higher security. Access can be prohibited by setting the permissions of the independent js file.