<head>
<title> New Document </title>
<script type="text/javascript">
var globle = "javascript"; //global是全局变量
test();
function test() {
var inside = "vbScript"; //声明了var , 局部变量
inside2 = "vbScript2"; //不声明var,那么该变量是全局变量
document.writeln(globle);
document.writeln(inside);
}
document.writeln(globle);
document.writeln(inside); //inside能不能得到取决于 其定义时写不写var
</script>
</head>