为何调用不到VBScript里的but1_onclick的方法。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="vbscript">
Sub but1_onclick()
dim a,b,j,res
j=Cint(Document.Form1.txt1.value)
num=2
Do while num<j+1
b=true
for a=2 to num\2
if num mod a=0 then
b=false
exit for
end if
next
if b=true then
res=res&num&"是素数<br/>"
a=a+1
end if
num=num+1
loop
div1.style.display=""
div1.innerHTML=res
end sub
</script>
<style type="text/css">
<!--
.d {
color: #000000;
font-size: 12px;
width: 50%;
background-color: #FEFAEE;
text-align: left;
}
-->
</style>
<title>统计素数</title>
</head>
<body>
<div align="center">
<p>统计提供的数字范围内所有的素数</p>
</div>
<form name="form1" method="get" action="">
<div align="center">
<table width="90%" border="0">
<tr>
<td width="30%" align="right"><span class="STYLE3"></span>请输入数字:</td>
<td width="59%" align="left"><input name="txt1" type="text" id="txt1" size="30" maxlength="3">
<input type="button" name="but1" id="but1" value="查询" onclick="but1_onclick" /></td>
</tr>
</table>
<div class="d" id="div1" style="display:none"></div>
</div>
</form>
</body>
</html>