Home > Developer > JavaScript
Tags: core case-sensitive multi-state display technology Tor Job center SPL
Js
First, JS overview
1.1 JS History
1.2 ECMAScript
Although ECMAScript is an important standard, it is not the only part of JavaScript, and certainly not the only one that is standardized. In fact, a complete JavaScript implementation is made up of the following 3 different parts:
To put it simply, ECMAScript describes the following:
Introduction Method of 1.3 JS
1 {#1 Write #}2 <script>3 alert (' Hello Yuan ') JS block is recommended to be placed at the bottom of the body block 4 </script>5 {#2 import file #}6 <script src= "Hello.js" ></script>
Second, JS basic knowledge
2.1 Variables
Declare variables using the keyword ' var ', var a=1;
You can declare multiple variables on a single line.var name
=
"lfd"
, age
=
20
, job
=
"lecturer"
;
You can declare variables without var. If you do not use Var then it is a global variable.
Variable name, the first character can only be letter, underscore, $ dollar symbol three select one, and case-sensitive, x and X are two variables.
Variable naming laws:
View Code1 camel notation 2 The first letter is lowercase and the next letter begins with an uppercase character. For example: 3 var mytestvalue = 0, Mysecondvalue = "HI" 4 pascal notation 5 The first letter is uppercase and the next letter begins with an uppercase character. For example: 6 Var mytestvalue = 0, Mysecondvalue = "HI" 7 Hungarian type notation 8 9 Var imytestvalue = 0, Smysecondvalue =" HI ";
JavaScript of HTML