![]() |
#2
dzt00012010-11-10 21:39
|

1.asp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.>
<html xmlns="http://www.>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="js/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function c(){
$.get("a.asp", {username: "John"},
function(data){
$('#a').html(data);
});
}
</script>
</head>
<body>
<input type="button" onclick="c()" value="test" />
<div id="a"></div>
</body>
</html>
a.asp
<!--#include file="conn.asp"-->
<%
Dim checkName,sql
checkName = request("username")
if checkName <> empty then
sql="select count(*) as num from UserMember where userName = '" & checkName & "'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1
response.Write(rs("num"))
rs.close
set rs = nothing
conn.close
set conn = nothing
end if
%>
点击按钮后,div上不显示任何内容,根据sql语句查询,应该显示1的。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.>
<html xmlns="http://www.>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="js/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function c(){
$.get("a.asp", {username: "John"},
function(data){
$('#a').html(data);
});
}
</script>
</head>
<body>
<input type="button" onclick="c()" value="test" />
<div id="a"></div>
</body>
</html>
a.asp
<!--#include file="conn.asp"-->
<%
Dim checkName,sql
checkName = request("username")
if checkName <> empty then
sql="select count(*) as num from UserMember where userName = '" & checkName & "'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1
response.Write(rs("num"))
rs.close
set rs = nothing
conn.close
set conn = nothing
end if
%>
哪里出问题了呢?