为什么asp中的onclick不跳转?

vmajndzz 2020-06-29 01:50:59
<%@LANGUAGE="JAVASCRIPT" 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" />
<title>无标题文档</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
<p>
<input type="checkbox" name="checkbox" id="checkbox" value="lanqiu"/>
篮球
<input type="checkbox" name="checkbox" id="checkbox2" value="zuqiu"/>
足球</p>
<p>
<input type="submit" name="button" id="button" value="购物" onclick="b.asp" />
</p>
</form>
</body>
</html>
...全文
4892 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
山东蓝鸟贵薪 2020-07-07
  • 打赏
  • 举报
回复
你根据我的你做一个简单的测试试一下
<%@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>
<!--页面使用utf-8否则容易乱码-->
<title>test</title>
<link rel="shortcut icon" href="images/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

</head>
<div >
<body>

<form>
<p>
<input type="button" id="123" name="Test_demo" value="按钮测试DEMO" onclick="Test_demo_jsShow()" />
</p>


</div>
</form>

</body>

</html>

<script language="javascript">
{

function Test_demo_jsShow()
{
alert("你点[按扭测试DEMO]");
}

}
</script>
======================================================
注明一下:
你将我上面的代码保存为 index.asp,再在IIS中运行一下看看效果

这个 按扭 功能就是点击后,执行JS语句并弹出一个 对话框 的
thornsz 2020-06-30
  • 打赏
  • 举报
回复
你把 a=Request.Form("a"); Response.Write(a); 删掉,看看B能不能显示,如果可以,说明取值正常,是显示的问题 可以把a=Request.Form("a");b=Request.Form("b");...全部写上面,下面写显示语句看看,一步步排除
vmajndzz 2020-06-29
  • 打赏
  • 举报
回复
引用 1 楼 jio可 的回复:
你这个又不是超链接 <a href="b.asp"> <input type="submit" name="button" id="button" value="购物" /> </a> 或者 <input type="submit" name="button" id="button" value="购物" onclick="pay()" /> function pay() { location.href = 'b.asp' }
谢谢!已经解决了! 还有想问一下,为什么这段代码只输出了a? <% a=Request.Form("a"); Response.Write(a); b=Request.Form("b"); Response.Write(b); c=Request.Form("c"); Response.Write(c); d=Request.Form("d"); Response.Write(d); e=Request.Form("e"); Response.Write(e); f=Request.Form("f"); Response.Write(f); g=Request.Form("g"); Response.Write(g); h=Request.Form("h"); Response.Write(h); %>
jio可 2020-06-29
  • 打赏
  • 举报
回复
你这个又不是超链接 <a href="b.asp"> <input type="submit" name="button" id="button" value="购物" /> </a> 或者 <input type="submit" name="button" id="button" value="购物" onclick="pay()" /> function pay() { location.href = 'b.asp' }

28,391

社区成员

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

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