Home > Web Front-end > JS Tutorial > body text

Implementation code of Ajax based on jQuery to verify whether user name exists_jquery

WBOY
Release: 2016-05-16 18:08:37
Original
924 people have browsed it

Example:
1. Request page AJax.aspx
HTML code

Copy code The code is as follows:



div>
div>

JS code
Copy code The code is as follows:




2, page AjaxUserInfoModify.aspx
Backend code
Copy code The code is as follows:

protected void Page_Load(object sender, EventArgs e)
{
string userName = Request.QueryString["userName"].ToString ();
if (userName == "James Hao")
{
Response.Write ("Username already exists! ");
}
else
{
Response.Write ("You can use this username!");
}
}

3 , run interface

(1)Initialization interface

(2) Querying prompt page

(3) Verify that the username already exists on the page

(4) Verify that the username does not exist on the page

At this point, the AJAX function to verify whether the user name exists has been completed.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!