引入方法
-
页面内嵌
<script type="text/javascript"> </script>
-
外部引入
<script src="js文件"></script>
js基础语法
-
变量(variable)
变量声明
声明、赋值分解
单一var
<script type="text/javascript">
var a;
a=100;
var b =100;
</script>
命名规则
变量名必须以英文字母、_、$开头
变量名可以包括英文字母、_、¥、数字
不可以用系统的关键字、保留字作为变量名
abstract arguments boolean break byte
case catch char class* const
continue debugger default delete do
double else enum* eval export*
extends* false final finally float
for function goto if implements
import* in instanceof int interface
let long native new null
package private protected public return
short static super* switch synchronized
this throw throws transient true
try typeof var void volatile
while with yield