Ajax User Detection

Source: Internet
Author: User

Ajax brings the user experience is obvious to all, the smallest application, we try to achieve. Still use the Hotheart Ajaxrequest class, starting with Ajax in another article, ASP.

The implementation effect is as follows:

The other is not much to say, the old rules, look at the code:

reg.html

<title>AJAX用户名检测</title>
<script type="text/javascript" src="ajaxrequest.js"></script>
<script type="text/javascript" >
var ajax=new AJAXRequest();
function regCheck() {
 var uname=document.getElementById("user_name");
 ajax.get("proc_user.asp? action=regcheck&user_name="+uname.value,usercheck);
}
function usercheck(obj) {
 document.getElementById("msg_user_name").innerHTML=unescape (obj.responseText);
}
</script>
<body>
用户名:<input type="text" name="user_name" id="user_name"/>
<button onclick="regCheck();">检测用户</button><label id="msg_user_name">注:数据库中只有admin和shaoyun两个用户</label>
</body>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.