<html>
<%! int i; %>
<% i = 1; %>
<head>
</head>
<body>
<script>
function aaa()
{
if(i == 1)
{
alert("Is 1");
}
else
{
alert("Is other");
}
}
aaa();
</script>
</body>
</html>
<%! int i; %>
<% i = 1; %>
<head>
</head>
<body>
<script>
function aaa()
{
if(i == 1)
{
alert("Is 1");
}
else
{
alert("Is other");
}
}
aaa();
</script>
</body>
</html>
function aaa()
{
if(i == 1)改为:
function aaa()
{
var i=parseInt('<%=i%>');
if(i == 1)