AJAX is the art of exchanging data with a server and updating parts of a web page without reloading the entire page.
AJAX = Asynchronous JavaScript and XML.
AJAX is a technology for creating fast, dynamic web pages.
var ur_loginName = document.getElementById("ur_loginName").value;
var login = document.getElementById("login" );
var id = "${sessionScope.user.ur_id}";
var ymsz = /^[A-Za-z0-9]+$/;
var loginname = document.getElementById( "loginname").value;
if(loginname==ur_loginName){
return true;
}else if (kong.test(ur_loginName)) {
login.style.color = "red ";
# xml.open("get", "AJAXServlet.do", true);
xml.setRequestHeader("name", ur_loginName);
xml.setRequestHeader("ur_id", id);
x ml .send(null);
;
var login = document.getElementById( "login");
if (msg == 1) {
Login.style.color = "red";
Login.innerhtml = "× The user name has been used";
Return false; nerHTML = " √ This username can be used";
return true;
Login.style.color = "red";
Login.innerHTML = " × The account format is not Correct ":
Return false;
}
}
## Use ajax to dynamically update the username when clicking the Input box to determine whether the input user name exists
The above is the detailed content of Java servlet ajax. For more information, please follow other related articles on the PHP Chinese website!