请帮我用javascript写ASP!

xinwlx 2003-01-21 12:59:24
下面我用vbscript写的一段ASP,请大虾帮我用javascript重新写一遍。不胜感激!<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>

<p>姓名:<%name1=request("name")%><%=name1%></p>

<p>性别:<%xingbie=request("xingbie1")%>
<%if xingbie="true" then
response.write"男"
else
response.write"女"
end if
%></p>

<p>省份:<%shengfen1=request("shengfen")%><%=shengfen1%></p>

<p>爱好:<%aihao1_1=request("aihao1")
aihao2_2=request("aihao2")%>
<%if aihao1_1="ON" then
response.write"电脑"
end if
if aihao2_2="ON" then
response.write" 看书"
end if
if (xingbie="true")AND(aihao1_1<>"ON")AND(aihao2_2<>"ON") then
response.write"他没有爱好!"
end if
if (xingbie<>"true")AND(aihao1_1<>"ON")AND(aihao2_2<>"ON") then
response.write"她没有爱好!"
end if
%>
</p>
</body>

</html>

最好是发进我的信箱!my address is:xinwlx@sina.com
...全文
57 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
叶子哟 2003-01-21
  • 打赏
  • 举报
回复
查msdn
griefforyou 2003-01-21
  • 打赏
  • 举报
回复
晚来一步
genuis 2003-01-21
  • 打赏
  • 举报
回复
注意几点
1,vbs使用的连接符号是& js是+
2,vbs使用的比较符号是 <> = js是 != ==
3,vbs调用函数一般不用(),而js必须用()把参数括起来
以上是比较容易出错的,还要看他们的基本语法差别
saucer 2003-01-21
  • 打赏
  • 举报
回复
try


<%@ Language="JavaScript" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>
<p>姓名:<%name1=Request("name").Item != null? Request("name").Item :"";%><%=name1%></p>
<p>性别:<%xingbie=Request("xingbie1").Item != null ? Request("xingbie1").Item.toLowerCase() :"";%>
<%if(xingbie =="true")
Response.Write ("男");
else
Response.Write("女");
%></p>

<p>省份:<%shengfen1=Request("shengfen").Item != null ? Request("shengfen").Item:"";%><%=shengfen1%></p>

<p>爱好:<% aihao1_1=Request("aihao1").Item != null? Request("aihao1").Item.toUpperCase():"";
aihao2_2=Request("aihao2").Item != null? Request("aihao2").Item.toUpperCase():"";

if (aihao1_1=="ON")
Response.Write("电脑");

if (aihao2_2=="ON")
Response.Write(" 看书");

if (xingbie=="true" && aihao1_1 != "ON" && aihao2_2 != "ON")
Response.Write ("他没有爱好!");


if (xingbie != "true" && aihao1_1 != "ON" && aihao2_2 !="ON")
Response.Write ("她没有爱好!");
%>
</p>
</body>

</html>

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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