<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>
<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>
那错了 ?
至少下面的是对的
<%
stri="123"
response.Write(" <script language='javascript'> window.alert("& stri &");location.href='login.html' </script>")
%>
window.alert(abcsdfg)....
abcsdfg是个变量么?不是,就报错了呗
response.Write(" <script language='javascript'> window.alert('"& stri &"');location.href='login.html' </script>")
alert里面用单引号;
语句以分号结束