<script>
var intV = 0;
function a()
{
alert(intV)
intV+=1
alert(intV)
}
function b(){
alert(intV)
}
</script>
<body onload=a()>
<input type=button value=a onclick=b()>值改变
var intV = 0;
function a()
{
alert(intV)
intV+=1
alert(intV)
}
function b(){
alert(intV)
}
</script>
<body onload=a()>
<input type=button value=a onclick=b()>值改变
<%
//intV是全局变量.
var intV = 0;
function change()
{
//这样直接改变全局变量的值
intV=100;
}
change();
Response.Write(intV);
%>