为何调用不到VBScript里的but1_onclick的方法。

fjaccp 2014-11-14 04:25:11
<%@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>
...全文
122 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Go 旅城通票 2014-11-14
  • 打赏
  • 举报
回复
你的vbs,只能IE跑。。。不要告诉我你用firefox,chrome来跑你的代码 如果是高版本ie,可能不支持vbs鸟。。自己查下
slwsss 2014-11-14
  • 打赏
  • 举报
回复
js调用不到后台脚本,用ajax处理

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧