首页 > 代码库 > 老八系统简易调用AJAX
老八系统简易调用AJAX
<script src="http://www.mamicode.com/js/jquery-1.7.2.min.js"></script> <script> $(function(){ $("#txtaccount").blur(function(){ $.post("check.asp", { name:$(this).val(), type:"tjnickname" }, function(data,status){ if(data=http://www.mamicode.com/=‘0‘){ $("#nicknamemsg").html(" <font color=‘green‘>会员编号不存在</font>"); } else{ $("#nicknamemsg").html(" <font color=‘green‘> " + data + " </font>"); } }); }); }) </script>
check.asp
<!--#include file="inc/common.asp"--> <% Response.ContentType = "text/html" Response.Charset = "GB2312" dim rs,sql,rs1,sql1 opendb() if request.form("type")="useraccount" then set rs=server.CreateObject("Adodb.Recordset") sql="select 1 from members where User_Account=‘"&request("name")&"‘" rs.open sql,con if rs.eof or rs.bof then response.Write "0" else response.Write "1" end if rs.close() set rs=nothing end if if request.form("type")="tjnickname" then set rs=server.CreateObject("Adodb.Recordset") sql="select User_NickName from members where User_Account=‘"&request("name")&"‘ and User_Check = 1" rs.open sql,con if rs.eof or rs.bof then response.Write "0" else response.Write rs("User_NickName") end if rs.close() set rs=nothing end if if request.form("type")="regcenter" then set rs=server.CreateObject("Adodb.Recordset") sql="select User_ID,Reg_Center_ID from Reg_Center where Reg_Center_Code=‘"&request("name")&"‘ and Reg_Check = 1" rs.open sql,con if rs.eof or rs.bof then response.Write "0" else set rs1=server.CreateObject("Adodb.Recordset") sql1 = "select User_NickName from members where User_ID="& rs("User_ID") &"" rs1.open sql1,con response.Write rs1("User_NickName") rs1.close() set rs1 = nothing end if rs.close() set rs = nothing end if closedb() %>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。