textbox中输入用户名,若数据库中存在,则提示用户名存在!!ajax

解决方案 »

  1.   

    http://www.cnblogs.com/zhzhqiu/archive/2009/02/27/1400027.html
    看看这个!!
      

  2.   

                     $.ajax({
                            url: "AjaxHandler/RegisterHandler.ashx",//ajax路径
                            data: { name: name },//传参数
                            cache: false,
                            async: true,
                            dataType: "text",
                            success: function (data) {
                                if (data == "1") {//判断返回值
                                    alert("该昵称已存在");
                                    return false;
                                }
                                else {
                                    return true;
                                }
                            }
                        });