大放送啊 送分啊 速度啊

qi604388041 2008-05-10 05:00:48
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题文档</title>
</head>
<script language="javascript">
function checkq()
{var us=document.getElementById("us");
var pw=document.getElementById("pw");
var hh=document.getElementById("hh");
if (us.value!='' && pw.value!='')//|| 或, &&且
{
hh.submit}
}
</script>
<body>
<form action="lgreg.asp" method="get" name="hh">
<table align="right" style=" position:absolute;left:800;top:200" >
<tr><td>帐号</td><td><input type="text" name="us"></td>
<tr><td>密码</td><td><input type="password" name="pw"></td>
<tr><td><input type="button" onClick="checkq()" value="登陆" ></td><td><input type="reset" ></td>
</table>
</form>
</body>
</html>
...全文
84 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
kong521 2008-05-13
  • 打赏
  • 举报
回复
response.Write(" <script language='javascript'> window.alert('& stri &');location.href='login.html' </script>");
alert里面用单引号;
语句以分号结束
qi604388041 2008-05-10
  • 打赏
  • 举报
回复
应该是
response.Write(" <script language='javascript'> window.alert('"& stri &"');location.href='login.html' </script>")
qi604388041 2008-05-10
  • 打赏
  • 举报
回复
webphoenix 2008-05-10
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 qi604388041 的回复:]
response.Write(" <script language='javascript'> window.alert("& stri &");location.href='login.html' </script>")
那错了 ?
[/Quote]
多明显的错误,如果stri是个数值,当然没错,如果你的stri 是个字符串呢,

stri = "abcsdfg"

客户端看到的就是
window.alert(abcsdfg)....
abcsdfg是个变量么?不是,就报错了呗
allen0228 2008-05-10
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 qi604388041 的回复:]
response.Write(" <script language='javascript'> window.alert("& stri &");location.href='login.html' </script>")
那错了 ?
[/Quote]
没错啊
至少下面的是对的
<%
stri="123"
response.Write(" <script language='javascript'> window.alert("& stri &");location.href='login.html' </script>")
%>
街头小贩 2008-05-10
  • 打赏
  • 举报
回复
看不出来
qi604388041 2008-05-10
  • 打赏
  • 举报
回复
response.Write("<script language='javascript'> window.alert("& stri &");location.href='login.html'</script>")
那错了 ?
wzy_love_sly 2008-05-10
  • 打赏
  • 举报
回复

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题文档 </title>
</head>
<script language="javascript">
function checkq()
{var us=document.getElementById("us");
var pw=document.getElementById("pw");
var hh=document.getElementById("hh");
if (us.value!='' && pw.value!=''){
hh.submit()
}
else
{
alert('帐号或密码不能为空');
}
}
</script>
<body>
<form action="测试6.aspx" method="get" name="hh">
<table align="right" style=" position:absolute;left:800;top:200" >
<tr> <td>帐号 </td> <td> <input type="text" name="us"> </td>
<tr> <td>密码 </td> <td> <input type="password" name="pw"> </td>
<tr> <td> <input type="button" onClick="checkq()" value="登陆" > </td> <td> <input type="reset" > </td>
</table>
</form>
</body>
</html>
wzy_love_sly 2008-05-10
  • 打赏
  • 举报
回复
接分吧
zero8500 2008-05-10
  • 打赏
  • 举报
回复
不知道搞什么东西?????
s_liangchao1s 2008-05-10
  • 打赏
  • 举报
回复

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题文档 </title>
</head>
<script language="javascript">
function checkq()
{
var us=document.getElementById("us");
var pw=document.getElementById("pw");
if (us.value!='' && pw.value!='')//
{
document.hh.submit();
}
}
</script>
<body>
<form action="lgreg.asp" method="get" name="hh">
<table align="right" style=" position:absolute;left:800;top:200" >
<tr> <td>帐号 </td> <td> <input type="text" name="us"> </td>
<tr> <td>密码 </td> <td> <input type="password" name="pw"> </td>
<tr> <td> <input type="button" onClick="checkq()" value="登陆" > </td> <td> <input type="reset" > </td>
</table>
</form>
</body>
</html>

87,910

社区成员

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

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