<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312" />
<title> 函数和变量作用域</title>
<!-- 脚本部分 -->
<script type="text/javascript">
var v1, v2;
v1=10;
v2=20;
function a(){
var v2, v3;
alert("v1 = "+v1+"\r\nv2 = "+v2+"\r\nv3 = "+v3);
v2=v3=40;
function b(v3, v4){
alert("v3 = "+v3+"\r\nv4="+v4);
v2=v3=80;
}
b(v3);
alert("v2="+v2+"\r\nv3="+v3);
alert(v4);
}
a();
</script>
</head>
<body style="overflow:auto;">
</body>
</html>