首页 > 其他 > 详细

老八系统简易调用AJAX

时间:2014-05-29 15:03:00      阅读:523      评论:0      收藏:0      [点我收藏+]

 

bubuko.com,布布扣
<script src="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==‘0‘){
                    $("#nicknamemsg").html("&nbsp;&nbsp;<font color=‘green‘>会员编号不存在</font>");
                      }
                      else{
                      $("#nicknamemsg").html("&nbsp;&nbsp;<font color=‘green‘> " + data + " </font>");
                      }
                  });
            });
        })
    </script>
  
bubuko.com,布布扣

check.asp

bubuko.com,布布扣
<!--#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()
%>
bubuko.com,布布扣

 

老八系统简易调用AJAX,布布扣,bubuko.com

老八系统简易调用AJAX

原文:http://www.cnblogs.com/mssql8/p/3758568.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!